From d42d294c95a2670b2b9da74c7d6074c4a9b92755 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr / DashieTM Date: Thu, 13 Oct 2022 01:41:22 +0200 Subject: [PATCH] feat: add spell check --- nivm/lua/settings/autocommands.lua | 2 - nivm/lua/settings/bufferline.lua | 146 ----------- nivm/lua/settings/cmp.lua | 133 ---------- nivm/lua/settings/colorscheme.lua | 6 - nivm/lua/settings/comment.lua | 22 -- nivm/lua/settings/cpp-dap.lua | 45 ---- nivm/lua/settings/dap-ui.lua | 73 ------ nivm/lua/settings/dap.lua | 126 ---------- nivm/lua/settings/dashboard.lua | 42 ---- nivm/lua/settings/devicons.lua | 23 -- nivm/lua/settings/feline.lua | 8 - nivm/lua/settings/gitsigns.lua | 1 - nivm/lua/settings/haskell.lua | 43 ---- nivm/lua/settings/impatient.lua | 6 - nivm/lua/settings/indentline.lua | 70 ------ nivm/lua/settings/keymaps.lua | 23 -- nivm/lua/settings/lint.lua | 4 - nivm/lua/settings/lsp.lua | 158 ------------ nivm/lua/settings/lsp_config/bashls.lua | 37 --- nivm/lua/settings/lsp_config/clangd.lua | 87 ------- nivm/lua/settings/lsp_config/csharp_ls.lua | 20 -- nivm/lua/settings/lsp_config/cssls.lua | 43 ---- nivm/lua/settings/lsp_config/eslint.lua | 165 ------------- nivm/lua/settings/lsp_config/eslint_d.lua | 165 ------------- nivm/lua/settings/lsp_config/handlers.lua | 100 -------- nivm/lua/settings/lsp_config/html.lua | 43 ---- nivm/lua/settings/lsp_config/jdtls.lua | 17 -- nivm/lua/settings/lsp_config/pyright.lua | 55 ----- .../lua/settings/lsp_config/rust_analyzer.lua | 77 ------ nivm/lua/settings/lsp_config/sqls.lua | 23 -- nivm/lua/settings/lsp_config/sumneko_lua.lua | 16 -- nivm/lua/settings/lsp_config/texlab.lua | 16 -- nivm/lua/settings/lsp_config/tsserver.lua | 56 ----- nivm/lua/settings/lua_codeactions.lua | 14 -- nivm/lua/settings/null-ls.lua | 44 ---- nivm/lua/settings/nvim-tree.lua | 233 ------------------ nivm/lua/settings/options.lua | 33 --- nivm/lua/settings/pairs.lua | 33 --- nivm/lua/settings/plugins.lua | 54 ---- nivm/lua/settings/prettier.lua | 19 -- nivm/lua/settings/project.lua | 48 ---- nivm/lua/settings/rainbow.lua | 14 -- nivm/lua/settings/telescope.lua | 8 - nivm/lua/settings/test.log | 57 ----- nivm/lua/settings/treesitter.lua | 21 -- nivm/lua/settings/vimtex.lua | 24 -- nivm/settings/autocommands.lua | 2 - nivm/settings/bufferline.lua | 146 ----------- nivm/settings/cmp.lua | 133 ---------- nivm/settings/colorscheme.lua | 6 - nivm/settings/comment.lua | 22 -- nivm/settings/cpp-dap.lua | 45 ---- nivm/settings/dap-ui.lua | 73 ------ nivm/settings/dap.lua | 126 ---------- nivm/settings/dashboard.lua | 42 ---- nivm/settings/devicons.lua | 23 -- nivm/settings/feline.lua | 8 - nivm/settings/gitsigns.lua | 1 - nivm/settings/haskell.lua | 43 ---- nivm/settings/impatient.lua | 6 - nivm/settings/indentline.lua | 70 ------ nivm/settings/keymaps.lua | 23 -- nivm/settings/lint.lua | 4 - nivm/settings/lsp.lua | 158 ------------ nivm/settings/lsp_config/bashls.lua | 37 --- nivm/settings/lsp_config/clangd.lua | 87 ------- nivm/settings/lsp_config/csharp_ls.lua | 20 -- nivm/settings/lsp_config/cssls.lua | 43 ---- nivm/settings/lsp_config/eslint.lua | 165 ------------- nivm/settings/lsp_config/eslint_d.lua | 165 ------------- nivm/settings/lsp_config/handlers.lua | 100 -------- nivm/settings/lsp_config/html.lua | 43 ---- nivm/settings/lsp_config/jdtls.lua | 17 -- nivm/settings/lsp_config/pyright.lua | 55 ----- nivm/settings/lsp_config/rust_analyzer.lua | 77 ------ nivm/settings/lsp_config/sqls.lua | 23 -- nivm/settings/lsp_config/sumneko_lua.lua | 16 -- nivm/settings/lsp_config/texlab.lua | 16 -- nivm/settings/lsp_config/tsserver.lua | 56 ----- nivm/settings/lua_codeactions.lua | 14 -- nivm/settings/null-ls.lua | 44 ---- nivm/settings/nvim-tree.lua | 233 ------------------ nivm/settings/options.lua | 33 --- nivm/settings/pairs.lua | 33 --- nivm/settings/plugins.lua | 54 ---- nivm/settings/prettier.lua | 19 -- nivm/settings/project.lua | 48 ---- nivm/settings/rainbow.lua | 14 -- nivm/settings/telescope.lua | 8 - nivm/settings/test.log | 57 ----- nivm/settings/treesitter.lua | 21 -- nivm/settings/vimtex.lua | 24 -- nvim/init.lua | 52 ++-- nvim/lua/settings/autocommands.lua | 12 + nvim/lua/settings/barbar.lua | 44 ++++ nvim/lua/settings/bufferline.lua | 146 ----------- nvim/lua/settings/cmp.lua | 233 +++++++++--------- nvim/lua/settings/colorscheme.lua | 6 - nvim/lua/settings/comment.lua | 2 + nvim/lua/settings/cpp-dap.lua | 45 ---- nvim/lua/settings/dap-ui.lua | 73 ------ nvim/lua/settings/devicons.lua | 1 - nvim/lua/settings/feline.lua | 8 - nvim/lua/settings/gitsigns.lua | 1 - nvim/lua/settings/impatient.lua | 6 - nvim/lua/settings/indentline.lua | 6 +- nvim/lua/settings/keymaps.lua | 13 +- nvim/lua/settings/lint.lua | 4 - nvim/lua/settings/lsp.lua | 174 +++++++------ nvim/lua/settings/lua_codeactions.lua | 14 -- nvim/lua/settings/null-ls.lua | 10 +- nvim/lua/settings/nvim-tree.lua | 39 +-- nvim/lua/settings/options.lua | 28 +-- nvim/lua/settings/pairs.lua | 51 ++-- nvim/lua/settings/plugins.lua | 108 ++++---- nvim/lua/settings/prettier.lua | 19 -- nvim/lua/settings/project.lua | 30 +-- nvim/lua/settings/rainbow.lua | 9 +- nvim/lua/settings/telescope.lua | 8 - nvim/lua/settings/treesitter.lua | 19 +- nvim/lua/settings/vimtex.lua | 24 -- nvim/snippets/tex.snippets | 20 +- 122 files changed, 454 insertions(+), 5657 deletions(-) delete mode 100644 nivm/lua/settings/autocommands.lua delete mode 100644 nivm/lua/settings/bufferline.lua delete mode 100644 nivm/lua/settings/cmp.lua delete mode 100644 nivm/lua/settings/colorscheme.lua delete mode 100644 nivm/lua/settings/comment.lua delete mode 100644 nivm/lua/settings/cpp-dap.lua delete mode 100644 nivm/lua/settings/dap-ui.lua delete mode 100644 nivm/lua/settings/dap.lua delete mode 100644 nivm/lua/settings/dashboard.lua delete mode 100644 nivm/lua/settings/devicons.lua delete mode 100644 nivm/lua/settings/feline.lua delete mode 100644 nivm/lua/settings/gitsigns.lua delete mode 100644 nivm/lua/settings/haskell.lua delete mode 100644 nivm/lua/settings/impatient.lua delete mode 100644 nivm/lua/settings/indentline.lua delete mode 100644 nivm/lua/settings/keymaps.lua delete mode 100644 nivm/lua/settings/lint.lua delete mode 100644 nivm/lua/settings/lsp.lua delete mode 100644 nivm/lua/settings/lsp_config/bashls.lua delete mode 100644 nivm/lua/settings/lsp_config/clangd.lua delete mode 100644 nivm/lua/settings/lsp_config/csharp_ls.lua delete mode 100644 nivm/lua/settings/lsp_config/cssls.lua delete mode 100644 nivm/lua/settings/lsp_config/eslint.lua delete mode 100644 nivm/lua/settings/lsp_config/eslint_d.lua delete mode 100644 nivm/lua/settings/lsp_config/handlers.lua delete mode 100644 nivm/lua/settings/lsp_config/html.lua delete mode 100644 nivm/lua/settings/lsp_config/jdtls.lua delete mode 100644 nivm/lua/settings/lsp_config/pyright.lua delete mode 100644 nivm/lua/settings/lsp_config/rust_analyzer.lua delete mode 100644 nivm/lua/settings/lsp_config/sqls.lua delete mode 100644 nivm/lua/settings/lsp_config/sumneko_lua.lua delete mode 100644 nivm/lua/settings/lsp_config/texlab.lua delete mode 100644 nivm/lua/settings/lsp_config/tsserver.lua delete mode 100644 nivm/lua/settings/lua_codeactions.lua delete mode 100644 nivm/lua/settings/null-ls.lua delete mode 100644 nivm/lua/settings/nvim-tree.lua delete mode 100644 nivm/lua/settings/options.lua delete mode 100644 nivm/lua/settings/pairs.lua delete mode 100644 nivm/lua/settings/plugins.lua delete mode 100644 nivm/lua/settings/prettier.lua delete mode 100644 nivm/lua/settings/project.lua delete mode 100644 nivm/lua/settings/rainbow.lua delete mode 100644 nivm/lua/settings/telescope.lua delete mode 100644 nivm/lua/settings/test.log delete mode 100644 nivm/lua/settings/treesitter.lua delete mode 100644 nivm/lua/settings/vimtex.lua delete mode 100644 nivm/settings/autocommands.lua delete mode 100644 nivm/settings/bufferline.lua delete mode 100644 nivm/settings/cmp.lua delete mode 100644 nivm/settings/colorscheme.lua delete mode 100644 nivm/settings/comment.lua delete mode 100644 nivm/settings/cpp-dap.lua delete mode 100644 nivm/settings/dap-ui.lua delete mode 100644 nivm/settings/dap.lua delete mode 100644 nivm/settings/dashboard.lua delete mode 100644 nivm/settings/devicons.lua delete mode 100644 nivm/settings/feline.lua delete mode 100644 nivm/settings/gitsigns.lua delete mode 100644 nivm/settings/haskell.lua delete mode 100644 nivm/settings/impatient.lua delete mode 100644 nivm/settings/indentline.lua delete mode 100644 nivm/settings/keymaps.lua delete mode 100644 nivm/settings/lint.lua delete mode 100644 nivm/settings/lsp.lua delete mode 100644 nivm/settings/lsp_config/bashls.lua delete mode 100644 nivm/settings/lsp_config/clangd.lua delete mode 100644 nivm/settings/lsp_config/csharp_ls.lua delete mode 100644 nivm/settings/lsp_config/cssls.lua delete mode 100644 nivm/settings/lsp_config/eslint.lua delete mode 100644 nivm/settings/lsp_config/eslint_d.lua delete mode 100644 nivm/settings/lsp_config/handlers.lua delete mode 100644 nivm/settings/lsp_config/html.lua delete mode 100644 nivm/settings/lsp_config/jdtls.lua delete mode 100644 nivm/settings/lsp_config/pyright.lua delete mode 100644 nivm/settings/lsp_config/rust_analyzer.lua delete mode 100644 nivm/settings/lsp_config/sqls.lua delete mode 100644 nivm/settings/lsp_config/sumneko_lua.lua delete mode 100644 nivm/settings/lsp_config/texlab.lua delete mode 100644 nivm/settings/lsp_config/tsserver.lua delete mode 100644 nivm/settings/lua_codeactions.lua delete mode 100644 nivm/settings/null-ls.lua delete mode 100644 nivm/settings/nvim-tree.lua delete mode 100644 nivm/settings/options.lua delete mode 100644 nivm/settings/pairs.lua delete mode 100644 nivm/settings/plugins.lua delete mode 100644 nivm/settings/prettier.lua delete mode 100644 nivm/settings/project.lua delete mode 100644 nivm/settings/rainbow.lua delete mode 100644 nivm/settings/telescope.lua delete mode 100644 nivm/settings/test.log delete mode 100644 nivm/settings/treesitter.lua delete mode 100644 nivm/settings/vimtex.lua create mode 100644 nvim/lua/settings/barbar.lua delete mode 100644 nvim/lua/settings/bufferline.lua delete mode 100644 nvim/lua/settings/colorscheme.lua delete mode 100644 nvim/lua/settings/cpp-dap.lua delete mode 100644 nvim/lua/settings/dap-ui.lua delete mode 100644 nvim/lua/settings/feline.lua delete mode 100644 nvim/lua/settings/gitsigns.lua delete mode 100644 nvim/lua/settings/impatient.lua delete mode 100644 nvim/lua/settings/lint.lua delete mode 100644 nvim/lua/settings/lua_codeactions.lua delete mode 100644 nvim/lua/settings/prettier.lua delete mode 100644 nvim/lua/settings/telescope.lua delete mode 100644 nvim/lua/settings/vimtex.lua diff --git a/nivm/lua/settings/autocommands.lua b/nivm/lua/settings/autocommands.lua deleted file mode 100644 index ec7f220..0000000 --- a/nivm/lua/settings/autocommands.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.cmd('let g:vimtex_view_general_viewer = "evince"') -vim.cmd('let g:vimtex_compiler_method = "latexmk"') diff --git a/nivm/lua/settings/bufferline.lua b/nivm/lua/settings/bufferline.lua deleted file mode 100644 index cdf728b..0000000 --- a/nivm/lua/settings/bufferline.lua +++ /dev/null @@ -1,146 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator = { - style = 'icon', - }, - buffer_close_icon = "", - -- buffer_close_icon = '', - modified_icon = "●", - close_icon = "", - -- close_icon = '', - left_trunc_marker = "", - right_trunc_marker = "", - -- end, - max_name_length = 30, - max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_close_icon = true, - show_tab_indicators = false, - persist_buffer_sort = true,-- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - hover = { - enabled = true, - delay = 200, - reveal = {'close'} - }, - -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) - -- -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - }, - highlights = { - fill = { - fg = { attribute = "fg", highlight = "#ff0000" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - -- buffer_selected = { - -- guifg = {attribute='fg',highlight='#ff0000'}, - -- guibg = {attribute='bg',highlight='#0000ff'}, - -- gui = 'none' - -- }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - -- close_button_selected = { - -- guifg = {attribute='fg',highlight='TabLineSel'}, - -- guibg ={attribute='bg',highlight='TabLineSel'} - -- }, - - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - italic = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - separator_visible = { - fg = {attribute='bg',highlight='TabLine'}, - bg = {attribute='bg',highlight='TabLine'} - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, -} diff --git a/nivm/lua/settings/cmp.lua b/nivm/lua/settings/cmp.lua deleted file mode 100644 index ef9069a..0000000 --- a/nivm/lua/settings/cmp.lua +++ /dev/null @@ -1,133 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -vim.cmd('let g:snipMate = {"snippet_version" : 1 }') -require("luasnip/loaders/from_vscode").lazy_load() -require("luasnip.loaders.from_snipmate").lazy_load() - -local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" -end - ---   פּ ﯟ   some other good icons -local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} --- find more here: https://www.nerdfonts.com/cheat-sheet - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = false, - native_menu = false, - }, -} diff --git a/nivm/lua/settings/colorscheme.lua b/nivm/lua/settings/colorscheme.lua deleted file mode 100644 index 04f4019..0000000 --- a/nivm/lua/settings/colorscheme.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, _ = pcall(require, "nightfox") -if not status_ok then - return -end - -vim.cmd("colorscheme nightfox") diff --git a/nivm/lua/settings/comment.lua b/nivm/lua/settings/comment.lua deleted file mode 100644 index 2fa4a56..0000000 --- a/nivm/lua/settings/comment.lua +++ /dev/null @@ -1,22 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup { - pre_hook = function(ctx) - local U = require "Comment.utils" - - local location = nil - if ctx.ctype == U.ctype.block then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring { - key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - location = location, - } - end, -} diff --git a/nivm/lua/settings/cpp-dap.lua b/nivm/lua/settings/cpp-dap.lua deleted file mode 100644 index 5f86d08..0000000 --- a/nivm/lua/settings/cpp-dap.lua +++ /dev/null @@ -1,45 +0,0 @@ -local dap = require('dap') -dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', - command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7', -} - -dap.configurations.cpp = { - { - name = "Launch file", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = "Launch file --gui", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - args = {'--gui'}, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = 'Attach to gdbserver :1234', - type = 'cppdbg', - request = 'launch', - MIMode = 'gdb', - miDebuggerServerAddress = 'localhost:1234', - miDebuggerPath = '/usr/bin/gdb', - cwd = '${workspaceFolder}', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - }, -} - -dap.configurations.c = dap.configurations.cpp -dap.configurations.rust = dap.configurations.cpp diff --git a/nivm/lua/settings/dap-ui.lua b/nivm/lua/settings/dap-ui.lua deleted file mode 100644 index cbd3d24..0000000 --- a/nivm/lua/settings/dap-ui.lua +++ /dev/null @@ -1,73 +0,0 @@ -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - } -}) -require("dapui").setup() diff --git a/nivm/lua/settings/dap.lua b/nivm/lua/settings/dap.lua deleted file mode 100644 index 1a26926..0000000 --- a/nivm/lua/settings/dap.lua +++ /dev/null @@ -1,126 +0,0 @@ -local dap = require('dap') -dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', - command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7', -} - -dap.configurations.cpp = { - { - name = "Launch file", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = "Launch file --gui", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - args = {'--gui'}, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = 'Attach to gdbserver :1234', - type = 'cppdbg', - request = 'launch', - MIMode = 'gdb', - miDebuggerServerAddress = 'localhost:1234', - miDebuggerPath = '/usr/bin/gdb', - cwd = '${workspaceFolder}', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - }, -} - -dap.configurations.c = dap.configurations.cpp -dap.configurations.rust = dap.configurations.cpp - -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - } -}) -require("mason-nvim-dap").setup({ - ensure_installed = { "cpptools", - "bash-debug-adapter", - "firefox-debug-adapter", - "js-debug-adapter", - "node-debug2-adapter" - } -}) diff --git a/nivm/lua/settings/dashboard.lua b/nivm/lua/settings/dashboard.lua deleted file mode 100644 index 6ab1ec9..0000000 --- a/nivm/lua/settings/dashboard.lua +++ /dev/null @@ -1,42 +0,0 @@ -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - -local dashboard = require("alpha.themes.dashboard") -dashboard.section.header.val = { -[[ _______ ___ _______. __ __ __ _______ ]], -[[| \ / \ / || | | | | | | ____|]], -[[| .--. | / ^ \ | (----`| |__| | | | | |__ ]], -[[| | | | / /_\ \ \ \ | __ | | | | __| ]], -[[| '--' | / _____ \ .----) | | | | | | | | |____ ]], -[[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]] -} -dashboard.section.buttons.val = { - dashboard.button("f", " Find file", ":Telescope find_files "), - dashboard.button("e", " New file", ":ene startinsert "), - dashboard.button("p", " Find project", ":Telescope projects "), - dashboard.button("r", " Recently used files", ":Telescope oldfiles "), - dashboard.button("t", " Find text", ":Telescope live_grep "), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " Quit Neovim", ":qa"), -} - -local function footer() --- NOTE: requires the fortune-mod package to work - -- local handle = io.popen("fortune") - -- local fortune = handle:read("*a") - -- handle:close() - -- return fortune - return "dashie@shitgaem.online" -end - -dashboard.section.footer.val = footer() - -dashboard.section.footer.opts.hl = "Type" -dashboard.section.header.opts.hl = "Include" -dashboard.section.buttons.opts.hl = "Keyword" - -dashboard.opts.opts.noautocmd = true --- vim.cmd([[autocmd User AlphaReady echo 'ready']]) -alpha.setup(dashboard.opts) diff --git a/nivm/lua/settings/devicons.lua b/nivm/lua/settings/devicons.lua deleted file mode 100644 index 57c1386..0000000 --- a/nivm/lua/settings/devicons.lua +++ /dev/null @@ -1,23 +0,0 @@ -local status_ok , _ = pcall (require, "nvim-web-devicons") -if not status_ok then - return -end - - -require'nvim-web-devicons'.setup { - -- your personnal icons can go here (to override) - -- you can specify color or cterm_color instead of specifying both of them - -- DevIcon will be appended to `name` - override = { - zsh = { - icon = "", - color = "#428850", - cterm_color = "65", - name = "Zsh" - } - }; - - default = true; -} - -require'nvim-web-devicons'.get_icons() diff --git a/nivm/lua/settings/feline.lua b/nivm/lua/settings/feline.lua deleted file mode 100644 index afda8a9..0000000 --- a/nivm/lua/settings/feline.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, _ = pcall(require, "feline") -if not status_ok then - return -end - - -require('feline').setup() ---require('feline').winbar.setup() diff --git a/nivm/lua/settings/gitsigns.lua b/nivm/lua/settings/gitsigns.lua deleted file mode 100644 index 91fa65b..0000000 --- a/nivm/lua/settings/gitsigns.lua +++ /dev/null @@ -1 +0,0 @@ -require('gitsigns').setup() diff --git a/nivm/lua/settings/haskell.lua b/nivm/lua/settings/haskell.lua deleted file mode 100644 index d463870..0000000 --- a/nivm/lua/settings/haskell.lua +++ /dev/null @@ -1,43 +0,0 @@ - -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'haskell-language-server-wrapper', '--lsp' }, - filetypes = { 'haskell', 'lhaskell' }, - root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), - single_file_support = true, - settings = { - haskell = { - formattingProvider = 'ormolu', - }, - }, - lspinfo = function(cfg) - local extra = {} - local function on_stdout(_, data, _) - local version = data[1] - table.insert(extra, 'version: ' .. version) - end - - local opts = { - cwd = cfg.cwd, - stdout_buffered = true, - on_stdout = on_stdout, - } - local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) - vim.fn.jobwait { chanid } - return extra - end, - }, - - docs = { - description = [[ -https://github.com/haskell/haskell-language-server -Haskell Language Server - ]], - - default_config = { - root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], - }, - }, -} diff --git a/nivm/lua/settings/impatient.lua b/nivm/lua/settings/impatient.lua deleted file mode 100644 index 84419e0..0000000 --- a/nivm/lua/settings/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/nivm/lua/settings/indentline.lua b/nivm/lua/settings/indentline.lua deleted file mode 100644 index fdf5870..0000000 --- a/nivm/lua/settings/indentline.lua +++ /dev/null @@ -1,70 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" } -vim.g.indent_blankline_filetype_exclude = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", -} -vim.g.indentLine_enabled = 1 --- vim.g.indent_blankline_char = "│" -vim.g.indent_blankline_char = "▏" --- vim.g.indent_blankline_char = "▎" -vim.g.indent_blankline_show_trailing_blankline_indent = false -vim.g.indent_blankline_show_first_indent_level = true -vim.g.indent_blankline_use_treesitter = true -vim.g.indent_blankline_show_current_context = true -vim.g.indent_blankline_context_patterns = { - "class", - "return", - "function", - "method", - "^if", - "^while", - "jsx_element", - "^for", - "^object", - "^table", - "block", - "arguments", - "if_statement", - "else_clause", - "jsx_element", - "jsx_self_closing_element", - "try_statement", - "catch_clause", - "import_statement", - "operation_type", -} --- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59 -vim.wo.colorcolumn = "99999" - --- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]] --- vim.opt.list = true --- vim.opt.listchars:append "space:⋅" --- vim.opt.listchars:append "space:" --- vim.opt.listchars:append "eol:↴" - -indent_blankline.setup({ - -- show_end_of_line = true, - -- space_char_blankline = " ", - show_current_context = true, - -- show_current_context_start = true, - -- char_highlight_list = { - -- "IndentBlanklineIndent1", - -- "IndentBlanklineIndent2", - -- "IndentBlanklineIndent3", - -- }, -}) diff --git a/nivm/lua/settings/keymaps.lua b/nivm/lua/settings/keymaps.lua deleted file mode 100644 index f1f6ae3..0000000 --- a/nivm/lua/settings/keymaps.lua +++ /dev/null @@ -1,23 +0,0 @@ -local opts = { noremap = true, silent = true } - -local term_opts = { silent = true } - --- Shorten function name -local keymap = vim.api.nvim_set_keymap - - -keymap("n", "c", ":CodeActionMenu", opts) -keymap("n", "", ':lua require("dap").toggle_breakpoint()', opts) -keymap("n", "", ':lua require("dap").step_over()', opts) -keymap("n", "", ':lua require("dap").step_into()', opts) -keymap("n", "", ':lua require("dap").continue()', opts) -keymap("n", "", ':lua require("dap").close() :lua require("dapui").toggle()', opts) -keymap("n", "", ':lua require("dap").continue() :lua require("dapui").toggle()', opts) - -keymap("n", "t", ':lua require("nvim-tree").toggle()', opts) -keymap("n", "f", ':lua require("nvim-tree").focus()', opts) - -keymap("n", "", ':BufferLineMoveNext', opts) -keymap("n", "", ':BufferLineMovePrev', opts) - -keymap("n", "", ':lua vim.lsp.buf.format { async = true }', opts) diff --git a/nivm/lua/settings/lint.lua b/nivm/lua/settings/lint.lua deleted file mode 100644 index ad45d4c..0000000 --- a/nivm/lua/settings/lint.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('lint').linters_by_ft = { - javascript = {'eslint',}, - react = {'eslint',}, -} diff --git a/nivm/lua/settings/lsp.lua b/nivm/lua/settings/lsp.lua deleted file mode 100644 index beddafb..0000000 --- a/nivm/lua/settings/lsp.lua +++ /dev/null @@ -1,158 +0,0 @@ -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - return -end - -require("mason").setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } -}) - -require("mason-lspconfig").setup({ - ensure_installed = { - "cssls", -- css - "html", -- html - "eslint", -- latex - "clangd", -- cpp / c - "tsserver", -- python - "texlab", -- latex - "sumneko_lua", -- lua - "pyright", -- python - "rust_analyzer", -- rust - "jdtls", -- jdtls - "cmake", -- cmake - "bashls", -- shell - "ansiblels", -- ansible - "csharp_ls", -- dotnot - "hls" -- haskel - }, - automatic_installation = true -}) - -require('lspconfig')['cssls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['html'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['eslint'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['clangd'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['tsserver'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['texlab'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['sumneko_lua'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['pyright'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['rust_analyzer'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['jdtls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['cmake'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['bashls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['ansiblels'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['csharp_ls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['hls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - - - - - ---local status_ok2, lsp_installer = pcall(require, "mason") ---if not status_ok2 then --- return ---end --- ---local servers = {"jdtls" , "sumneko_lua" , "texlab", "pyright" , "eslint_d" , "html" , "cssls" , "rust_analyzer" , "bashls" , "csharp_ls" , "sqls" , "clangd" } --- ---lsp_installer.setup { --- ensure_installed = servers ---} --- ---for _, server in pairs(servers) do --- local opts = { --- on_attach = require("settings.lsp_config.handlers").on_attach, --- capabilities = require("settings.lsp_config.handlers").capabilities, --- } --- local has_custom_opts, server_custom_opts = pcall(require, "settings.lsp_config." .. server) --- if has_custom_opts then --- opts = vim.tbl_deep_extend("force", server_custom_opts, opts) --- end --- lspconfig[server].setup(opts) ---end --- --- ---local null_ls_status_ok, null_ls = pcall(require, "null-ls") ---if not null_ls_status_ok then --- return ---end --- ----- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting ---local formatting = null_ls.builtins.formatting ----- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics ---local diagnostics = null_ls.builtins.diagnostics --- ---null_ls.setup({ --- debug = false, --- sources = { --- formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), --- formatting.black.with({ extra_args = { "--fast" } }), --- formatting.stylua, --- -- diagnostics.flake8 --- }, ---}) diff --git a/nivm/lua/settings/lsp_config/bashls.lua b/nivm/lua/settings/lsp_config/bashls.lua deleted file mode 100644 index e2392e4..0000000 --- a/nivm/lua/settings/lsp_config/bashls.lua +++ /dev/null @@ -1,37 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'bash-language-server' -local cmd = { bin_name, 'start' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'start' } -end - -return { - default_config = { - cmd = cmd, - cmd_env = { - -- Prevent recursive scanning which will cause issues when opening a file - -- directly in the home directory (e.g. ~/foo.sh). - -- - -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". - GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', - }, - filetypes = { 'sh' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/mads-hartmann/bash-language-server -`bash-language-server` can be installed via `npm`: -```sh -npm i -g bash-language-server -``` -Language server for bash, written using tree sitter in typescript. -]], - default_config = { - root_dir = [[util.find_git_ancestor]], - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/clangd.lua b/nivm/lua/settings/lsp_config/clangd.lua deleted file mode 100644 index 65da8c0..0000000 --- a/nivm/lua/settings/lsp_config/clangd.lua +++ /dev/null @@ -1,87 +0,0 @@ -local util = require 'lspconfig.util' - --- https://clangd.llvm.org/extensions.html#switch-between-sourceheader -local function switch_source_header(bufnr) - bufnr = util.validate_bufnr(bufnr) - local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') - local params = { uri = vim.uri_from_bufnr(bufnr) } - if clangd_client then - clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) - if err then - error(tostring(err)) - end - if not result then - print 'Corresponding file cannot be determined' - return - end - vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) - end, bufnr) - else - print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' - end -end - -local root_files = { - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', -- AutoTools -} - -local default_capabilities = { - textDocument = { - completion = { - editsNearCursor = true, - }, - }, - offsetEncoding = { 'utf-8', 'utf-16' }, -} - -return { - default_config = { - cmd = { 'clangd' }, - filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) - end, - single_file_support = true, - capabilities = default_capabilities, - }, - commands = { - ClangdSwitchSourceHeader = { - function() - switch_source_header(0) - end, - description = 'Switch between source/header', - }, - }, - docs = { - description = [[ -https://clangd.llvm.org/installation.html -- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). -- If `compile_commands.json` lives in a build directory, you should - symlink it to the root of your source tree. - ``` - ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ - ``` -- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) - specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson -]], - default_config = { - root_dir = [[ - root_pattern( - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', - '.git' - ) - ]], - capabilities = [[default capabilities, with offsetEncoding utf-8]], - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/csharp_ls.lua b/nivm/lua/settings/lsp_config/csharp_ls.lua deleted file mode 100644 index a03a25b..0000000 --- a/nivm/lua/settings/lsp_config/csharp_ls.lua +++ /dev/null @@ -1,20 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'csharp-ls' }, - root_dir = util.root_pattern('*.sln', '*.csproj', '*.fsproj', '.git'), - filetypes = { 'cs' }, - init_options = { - AutomaticWorkspaceInit = true, - }, - }, - docs = { - description = [[ -https://github.com/razzmatazz/csharp-language-server -Language Server for C#. -csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. -The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. - ]], - }, -} diff --git a/nivm/lua/settings/lsp_config/cssls.lua b/nivm/lua/settings/lsp_config/cssls.lua deleted file mode 100644 index d1b7aa6..0000000 --- a/nivm/lua/settings/lsp_config/cssls.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-css-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'css', 'scss', 'less' }, - root_dir = util.root_pattern('package.json', '.git'), - single_file_support = true, - settings = { - css = { validate = true }, - scss = { validate = true }, - less = { validate = true }, - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`css-languageserver` can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. -```lua ---Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.cssls.setup { - capabilities = capabilities, -} -``` -]], - default_config = { - root_dir = [[root_pattern("package.json", ".git") or bufdir]], - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/eslint.lua b/nivm/lua/settings/lsp_config/eslint.lua deleted file mode 100644 index d456970..0000000 --- a/nivm/lua/settings/lsp_config/eslint.lua +++ /dev/null @@ -1,165 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local function fix_all(opts) - opts = opts or {} - - local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') - if eslint_lsp_client == nil then - return - end - - local request - if opts.sync then - request = function(bufnr, method, params) - eslint_lsp_client.request_sync(method, params, nil, bufnr) - end - else - request = function(bufnr, method, params) - eslint_lsp_client.request(method, params, nil, bufnr) - end - end - - local bufnr = util.validate_bufnr(opts.bufnr or 0) - request(0, 'workspace/executeCommand', { - command = 'eslint.applyAllFixes', - arguments = { - { - uri = vim.uri_from_bufnr(bufnr), - version = lsp.util.buf_versions[bufnr], - }, - }, - }) -end - -local bin_name = 'vscode-eslint-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - }, - -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - root_dir = util.root_pattern( - '.eslintrc', - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'package.json' - ), - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - packageManager = 'npm', - useESLintClass = false, - codeActionOnSave = { - enable = false, - mode = 'all', - }, - format = true, - quiet = false, - onIgnoredFiles = 'off', - rulesCustomizations = {}, - run = 'onType', - -- nodePath configures the directory in which the eslint server should start its node_modules resolution. - -- This path is relative to the workspace folder (root dir) of the server instance. - nodePath = '', - -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory - workingDirectory = { mode = 'location' }, - codeAction = { - disableRuleComment = { - enable = true, - location = 'separateLine', - }, - showDocumentation = { - enable = true, - }, - }, - }, - on_new_config = function(config, new_root_dir) - -- The "workspaceFolder" is a VSCode concept. It limits how far the - -- server will traverse the file system when locating the ESLint config - -- file (e.g., .eslintrc). - config.settings.workspaceFolder = { - uri = new_root_dir, - name = vim.fn.fnamemodify(new_root_dir, ':t'), - } - - -- Support Yarn2 (PnP) projects - local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') - local pnp_js = util.path.join(new_root_dir, '.pnp.js') - if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then - config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) - end - end, - handlers = { - ['eslint/openDoc'] = function(_, result) - if not result then - return - end - local sysname = vim.loop.os_uname().sysname - if sysname:match 'Windows' then - os.execute(string.format('start %q', result.url)) - elseif sysname:match 'Linux' then - os.execute(string.format('xdg-open %q', result.url)) - else - os.execute(string.format('open %q', result.url)) - end - return {} - end, - ['eslint/confirmESLintExecution'] = function(_, result) - if not result then - return - end - return 4 -- approved - end, - ['eslint/probeFailed'] = function() - vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) - return {} - end, - ['eslint/noLibrary'] = function() - vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) - return {} - end, - }, - }, - commands = { - EslintFixAll = { - function() - fix_all { sync = true, bufnr = 0 } - end, - description = 'Fix all eslint problems for this buffer', - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. -It can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. -Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` -Additional messages you can handle: `eslint/noConfig` -]], - }, -} diff --git a/nivm/lua/settings/lsp_config/eslint_d.lua b/nivm/lua/settings/lsp_config/eslint_d.lua deleted file mode 100644 index d456970..0000000 --- a/nivm/lua/settings/lsp_config/eslint_d.lua +++ /dev/null @@ -1,165 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local function fix_all(opts) - opts = opts or {} - - local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') - if eslint_lsp_client == nil then - return - end - - local request - if opts.sync then - request = function(bufnr, method, params) - eslint_lsp_client.request_sync(method, params, nil, bufnr) - end - else - request = function(bufnr, method, params) - eslint_lsp_client.request(method, params, nil, bufnr) - end - end - - local bufnr = util.validate_bufnr(opts.bufnr or 0) - request(0, 'workspace/executeCommand', { - command = 'eslint.applyAllFixes', - arguments = { - { - uri = vim.uri_from_bufnr(bufnr), - version = lsp.util.buf_versions[bufnr], - }, - }, - }) -end - -local bin_name = 'vscode-eslint-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - }, - -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - root_dir = util.root_pattern( - '.eslintrc', - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'package.json' - ), - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - packageManager = 'npm', - useESLintClass = false, - codeActionOnSave = { - enable = false, - mode = 'all', - }, - format = true, - quiet = false, - onIgnoredFiles = 'off', - rulesCustomizations = {}, - run = 'onType', - -- nodePath configures the directory in which the eslint server should start its node_modules resolution. - -- This path is relative to the workspace folder (root dir) of the server instance. - nodePath = '', - -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory - workingDirectory = { mode = 'location' }, - codeAction = { - disableRuleComment = { - enable = true, - location = 'separateLine', - }, - showDocumentation = { - enable = true, - }, - }, - }, - on_new_config = function(config, new_root_dir) - -- The "workspaceFolder" is a VSCode concept. It limits how far the - -- server will traverse the file system when locating the ESLint config - -- file (e.g., .eslintrc). - config.settings.workspaceFolder = { - uri = new_root_dir, - name = vim.fn.fnamemodify(new_root_dir, ':t'), - } - - -- Support Yarn2 (PnP) projects - local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') - local pnp_js = util.path.join(new_root_dir, '.pnp.js') - if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then - config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) - end - end, - handlers = { - ['eslint/openDoc'] = function(_, result) - if not result then - return - end - local sysname = vim.loop.os_uname().sysname - if sysname:match 'Windows' then - os.execute(string.format('start %q', result.url)) - elseif sysname:match 'Linux' then - os.execute(string.format('xdg-open %q', result.url)) - else - os.execute(string.format('open %q', result.url)) - end - return {} - end, - ['eslint/confirmESLintExecution'] = function(_, result) - if not result then - return - end - return 4 -- approved - end, - ['eslint/probeFailed'] = function() - vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) - return {} - end, - ['eslint/noLibrary'] = function() - vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) - return {} - end, - }, - }, - commands = { - EslintFixAll = { - function() - fix_all { sync = true, bufnr = 0 } - end, - description = 'Fix all eslint problems for this buffer', - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. -It can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. -Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` -Additional messages you can handle: `eslint/noConfig` -]], - }, -} diff --git a/nivm/lua/settings/lsp_config/handlers.lua b/nivm/lua/settings/lsp_config/handlers.lua deleted file mode 100644 index 5695f84..0000000 --- a/nivm/lua/settings/lsp_config/handlers.lua +++ /dev/null @@ -1,100 +0,0 @@ -local M = {} - --- TODO: backfill this to template -M.setup = function() - local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end - - local config = { - -- disable virtual text - virtual_text = false, - -- show signs - signs = { - active = signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - } - - vim.diagnostic.config(config) - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", - }) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "rounded", - }) -end - -local function lsp_highlight_document(client) - -- Set autocommands conditional on server_capabilities - local status_ok, illuminate = pcall(require, "illuminate") - if not status_ok then - return - end - illuminate.on_attach(client) - -- end -end - -local function lsp_keymaps(bufnr) - local opts = { noremap = true, silent = true } - vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "rn", "lua vim.lsp.buf.rename()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "ca", "lua vim.lsp.buf.code_action()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "f", "lua vim.diagnostic.open_float()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gl", - 'lua vim.diagnostic.open_float({ border = "rounded" })', - opts - ) - vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) - vim.cmd [[ command! Format execute 'lua vim.lsp.buf.format { async = true }' ]] -end - -M.on_attach = function(client, bufnr) - -- vim.notify(client.name .. " starting...") - -- TODO: refactor this into a method that checks if string in list - if client.name == "tsserver" then - client.resolved_capabilities.document_formatting = false - end - lsp_keymaps(bufnr) - lsp_highlight_document(client) -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() - -local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not status_ok then - return -end - -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) - -return M diff --git a/nivm/lua/settings/lsp_config/html.lua b/nivm/lua/settings/lsp_config/html.lua deleted file mode 100644 index b1771d3..0000000 --- a/nivm/lua/settings/lsp_config/html.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-html-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'html' }, - root_dir = util.root_pattern('package.json', '.git'), - single_file_support = true, - settings = {}, - init_options = { - provideFormatter = true, - embeddedLanguages = { css = true, javascript = true }, - configurationSection = { 'html', 'css', 'javascript' }, - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-html-language-server` can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. -To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. -The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. -```lua ---Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.html.setup { - capabilities = capabilities, -} -``` -]], - }, -} diff --git a/nivm/lua/settings/lsp_config/jdtls.lua b/nivm/lua/settings/lsp_config/jdtls.lua deleted file mode 100644 index 1254f9b..0000000 --- a/nivm/lua/settings/lsp_config/jdtls.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - settings = { - - java = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} - diff --git a/nivm/lua/settings/lsp_config/pyright.lua b/nivm/lua/settings/lsp_config/pyright.lua deleted file mode 100644 index 16513cc..0000000 --- a/nivm/lua/settings/lsp_config/pyright.lua +++ /dev/null @@ -1,55 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'pyright-langserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -local root_files = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', - 'pyrightconfig.json', -} - -local function organize_imports() - local params = { - command = 'pyright.organizeimports', - arguments = { vim.uri_from_bufnr(0) }, - } - vim.lsp.buf.execute_command(params) -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'python' }, - root_dir = util.root_pattern(unpack(root_files)), - single_file_support = true, - settings = { - python = { - analysis = { - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = 'workspace', - }, - }, - }, - }, - commands = { - PyrightOrganizeImports = { - organize_imports, - description = 'Organize Imports', - }, - }, - docs = { - description = [[ -https://github.com/microsoft/pyright -`pyright`, a static type checker and language server for python -]], - }, -} diff --git a/nivm/lua/settings/lsp_config/rust_analyzer.lua b/nivm/lua/settings/lsp_config/rust_analyzer.lua deleted file mode 100644 index bc85596..0000000 --- a/nivm/lua/settings/lsp_config/rust_analyzer.lua +++ /dev/null @@ -1,77 +0,0 @@ -local util = require 'lspconfig.util' - -local function reload_workspace(bufnr) - bufnr = util.validate_bufnr(bufnr) - vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) - if err then - error(tostring(err)) - end - vim.notify 'Cargo workspace reloaded' - end) -end - -return { - default_config = { - cmd = { 'rust-analyzer' }, - filetypes = { 'rust' }, - root_dir = function(fname) - local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) - local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } - if cargo_crate_dir ~= nil then - cmd[#cmd + 1] = '--manifest-path' - cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') - end - local cargo_metadata = '' - local cargo_metadata_err = '' - local cm = vim.fn.jobstart(cmd, { - on_stdout = function(_, d, _) - cargo_metadata = table.concat(d, '\n') - end, - on_stderr = function(_, d, _) - cargo_metadata_err = table.concat(d, '\n') - end, - stdout_buffered = true, - stderr_buffered = true, - }) - if cm > 0 then - cm = vim.fn.jobwait({ cm })[1] - else - cm = -1 - end - local cargo_workspace_dir = nil - if cm == 0 then - cargo_workspace_dir = vim.json.decode(cargo_metadata)['workspace_root'] - else - vim.notify( - string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), - vim.log.levels.WARN - ) - end - return util.path.sanitize(cargo_workspace_dir) - or cargo_crate_dir - or util.root_pattern 'rust-project.json'(fname) - or util.find_git_ancestor(fname) - end, - settings = { - ['rust-analyzer'] = {}, - }, - }, - commands = { - CargoReload = { - function() - reload_workspace(0) - end, - description = 'Reload current cargo workspace', - }, - }, - docs = { - description = [[ -https://github.com/rust-analyzer/rust-analyzer -rust-analyzer (aka rls 2.0), a language server for Rust -See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. - ]], - default_config = { - root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/sqls.lua b/nivm/lua/settings/lsp_config/sqls.lua deleted file mode 100644 index bdbf27b..0000000 --- a/nivm/lua/settings/lsp_config/sqls.lua +++ /dev/null @@ -1,23 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'sqls' }, - filetypes = { 'sql', 'mysql' }, - root_dir = util.root_pattern 'config.yml', - single_file_support = true, - settings = {}, - }, - docs = { - description = [[ -https://github.com/lighttiger2505/sqls -```lua -require'lspconfig'.sqls.setup{ - cmd = {"path/to/command", "-config", "path/to/config.yml"}; - ... -} -``` -Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). - ]], - }, -} diff --git a/nivm/lua/settings/lsp_config/sumneko_lua.lua b/nivm/lua/settings/lsp_config/sumneko_lua.lua deleted file mode 100644 index 0ac454a..0000000 --- a/nivm/lua/settings/lsp_config/sumneko_lua.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/texlab.lua b/nivm/lua/settings/lsp_config/texlab.lua deleted file mode 100644 index be0e199..0000000 --- a/nivm/lua/settings/lsp_config/texlab.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - - latex = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/nivm/lua/settings/lsp_config/tsserver.lua b/nivm/lua/settings/lsp_config/tsserver.lua deleted file mode 100644 index 0af4cb6..0000000 --- a/nivm/lua/settings/lsp_config/tsserver.lua +++ /dev/null @@ -1,56 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'typescript-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - init_options = { hostInfo = 'neovim' }, - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - }, - root_dir = function(fname) - return util.root_pattern 'tsconfig.json'(fname) - or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) - end, - }, - docs = { - description = [[ -https://github.com/theia-ide/typescript-language-server -`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: -```sh -npm install -g typescript typescript-language-server -``` -To configure typescript language server, add a -[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or -[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your -project. -Here's an example that disables type checking in JavaScript files. -```json -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "checkJs": false - }, - "exclude": [ - "node_modules" - ] -} -``` -]], - default_config = { - root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], - }, - }, -} diff --git a/nivm/lua/settings/lua_codeactions.lua b/nivm/lua/settings/lua_codeactions.lua deleted file mode 100644 index 1d24ff5..0000000 --- a/nivm/lua/settings/lua_codeactions.lua +++ /dev/null @@ -1,14 +0,0 @@ -local M = {} - -local lsp_util = vim.lsp.util - -function M.code_action_listener() - local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } - local params = lsp_util.make_range_params() - params.context = context - vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result) - -- do something with result - e.g. check if empty and show some indication such as a sign - end) -end - -return M diff --git a/nivm/lua/settings/null-ls.lua b/nivm/lua/settings/null-ls.lua deleted file mode 100644 index 5f33860..0000000 --- a/nivm/lua/settings/null-ls.lua +++ /dev/null @@ -1,44 +0,0 @@ -local null_ls = require("null-ls") - -require("mason-null-ls").setup({ - ensure_installed = { - "prettier", - "clang_format", - "latexindent", - "shellharden", - "sql_formatter", - "fixjson", - "autopep8", - "stylua", - "rustfmt", - "stylish-haskell", - }, -}) - -null_ls.setup({ - on_attach = function(client, bufnr) - if client.server_capabilities.documentFormattingProvider then - vim.cmd("nnoremap f :lua vim.lsp.buf.format { async = true }") - - -- format on save - vim.cmd("autocmd BufWritePost lua vim.lsp.buf.format { async = true }") - end - - if client.server_capabilities.documentRangeFormattingProvider then - vim.cmd("xnoremap f :lua vim.lsp.buf.range_formatting({})") - end - end, - sources = { - require("null-ls").builtins.completion.spell, - require("null-ls").builtins.formatting.prettier, - require("null-ls").builtins.formatting.clang_format, - require("null-ls").builtins.formatting.latexindent, - require("null-ls").builtins.formatting.shellharden, - require("null-ls").builtins.formatting.sql_formatter, - require("null-ls").builtins.formatting.fixjson, - require("null-ls").builtins.formatting.autopep8, - require("null-ls").builtins.formatting.stylua, - require("null-ls").builtins.formatting.rustfmt, - require("null-ls").builtins.formatting.stylish_haskell, - }, -}) diff --git a/nivm/lua/settings/nvim-tree.lua b/nivm/lua/settings/nvim-tree.lua deleted file mode 100644 index c995d02..0000000 --- a/nivm/lua/settings/nvim-tree.lua +++ /dev/null @@ -1,233 +0,0 @@ --- following options are the default --- each of these are documented in `:help nvim-tree.OPTION_NAME` - -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - --- Replaces auto_close ---local tree_cb = nvim_tree_config.nvim_tree_callback ---vim.api.nvim_create_autocmd("BufEnter", { --- nested = true, --- callback = function() --- if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then --- vim.cmd "quit" --- end --- end ---}) - - -nvim_tree.setup { -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - create_in_closed_folder = false, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - ignore_buffer_on_setup = false, - open_on_setup = true, - open_on_setup_file = true, - open_on_tab = true, - ignore_buf_on_tab_change = {}, - sort_by = "name", - root_dirs = {}, - prefer_startup_root = false, - sync_root_with_cwd = false, - reload_on_bufenter = false, - respect_buf_cwd = false, - on_attach = "disable", -- function(bufnr). If nil, will use the deprecated mapping strategy - remove_keymaps = false, -- boolean (disable totally or not) or list of key (lhs) - view = { - adaptive_size = false, - centralize_selection = false, - width = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - -- @deprecated - mappings = { - custom_only = false, - list = { - -- user mappings go here - }, - }, - float = { - enable = false, - open_win_config = { - relative = "editor", - border = "rounded", - width = 30, - height = 30, - row = 1, - col = 1, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - root_folder_modifier = ":~", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, - icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - bookmark = "", - folder = { - arrow_closed = "", - arrow_open = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - special_files = { "cargo.toml", "makefile", "readme.md", "readme.md" }, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_root = false, - ignore_list = {}, - }, - ignore_ft_on_setup = {}, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - debounce_delay = 50, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - custom = {}, - exclude = {}, - }, - filesystem_watchers = { - enable = true, - debounce_delay = 50, - }, - git = { - enable = true, - ignore = true, - show_on_dirs = true, - timeout = 400, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, - }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { - enable = true, - chars = "abcdefghijklmnopqrstuvwxyz1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - remove_file = { - close_window = true, - }, - }, - trash = { - cmd = "gio trash", - require_confirm = true, - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, - }, - }, - } - -vim.g.nvim_tree_group_empty = 1 diff --git a/nivm/lua/settings/options.lua b/nivm/lua/settings/options.lua deleted file mode 100644 index 047d1c5..0000000 --- a/nivm/lua/settings/options.lua +++ /dev/null @@ -1,33 +0,0 @@ -local options = { - clipboard = "unnamedplus", - mouse = "a", - fileencoding = "utf-8", - relativenumber = true, - smartindent = true, - smartcase = true, - showmode = true, - termguicolors = true, --- winbar = "", - ignorecase = true, - showtabline = 2, - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default) - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, - scrolloff = 8, -- is one of my fav - sidescrolloff = 8, - spell = true, - spelllang = "en_us", - mousemodel = "popup_setpos", -} - ---vim.opt.shortmess:append "c" - -for k, v in pairs(options) do - vim.opt[k] = v -end - - diff --git a/nivm/lua/settings/pairs.lua b/nivm/lua/settings/pairs.lua deleted file mode 100644 index 577e571..0000000 --- a/nivm/lua/settings/pairs.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/nivm/lua/settings/plugins.lua b/nivm/lua/settings/plugins.lua deleted file mode 100644 index 0c1a96f..0000000 --- a/nivm/lua/settings/plugins.lua +++ /dev/null @@ -1,54 +0,0 @@ -local Plug = vim.fn['plug#'] -vim.call('plug#begin', '~/.config/nvim/plugged') -Plug 'folke/twilight.nvim' -Plug 'nvim-lua/popup.nvim' -- An implementation of the Popup API from vim in Neovim -Plug 'nvim-lua/plenary.nvim' -- Useful lua functions used ny lots of plugins -Plug 'EdenEast/nightfox.nvim' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'feline-nvim/feline.nvim' -Plug 'lewis6991/gitsigns.nvim' -Plug 'tanvirtin/vgit.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'b3nj5m1n/kommentary' -Plug 'antoinemadec/FixCursorHold.nvim' -Plug 'lambdalisue/fern.vim' -Plug "williamboman/mason.nvim" -Plug "williamboman/mason-lspconfig.nvim" -Plug 'neovim/nvim-lspconfig' -Plug 'jose-elias-alvarez/null-ls.nvim' -Plug 'jayp0521/mason-null-ls.nvim' -Plug 'mfussenegger/nvim-dap' -Plug 'rcarriga/nvim-dap-ui' -Plug 'theHamsta/nvim-dap-virtual-text' -Plug 'jayp0521/mason-nvim-dap.nvim' -Plug('nvim-treesitter/nvim-treesitter', { ['do'] = vim.fn[':TSUpdate'] }) -Plug 'hrsh7th/nvim-cmp' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'saadparwaiz1/cmp_luasnip' -Plug 'L3MON4D3/LuaSnip' -Plug 'MarcWeber/vim-addon-mw-utils' -Plug 'tomtom/tlib_vim' -Plug 'garbas/vim-snipmate' -Plug 'kyazdani42/nvim-tree.lua' -Plug 'windwp/nvim-autopairs' -Plug 'akinsho/bufferline.nvim' -Plug 'numToStr/Comment.nvim' -Plug 'lukas-reineke/indent-blankline.nvim' -Plug 'lewis6991/impatient.nvim' -Plug 'lewis6991/spellsitter.nvim' -Plug 'moll/vim-bbye' -Plug 'nvim-telescope/telescope.nvim' -Plug 'ahmedkhalf/project.nvim' -Plug 'goolord/alpha-nvim' -Plug 'lervag/vimtex' -Plug 'weilbith/nvim-code-action-menu' -Plug 'MunifTanjim/prettier.nvim' -Plug 'rafamadriz/friendly-snippets' -Plug 'p00f/nvim-ts-rainbow' -Plug 'nvim-telescope/telescope-ui-select.nvim' -Plug 'nvim-telescope/telescope-file-browser.nvim' -Plug 'nvim-telescope/telescope-fzy-native.nvim' -vim.call('plug#end') diff --git a/nivm/lua/settings/prettier.lua b/nivm/lua/settings/prettier.lua deleted file mode 100644 index 91e8bb5..0000000 --- a/nivm/lua/settings/prettier.lua +++ /dev/null @@ -1,19 +0,0 @@ -local prettier = require("prettier") - -prettier.setup({ - bin = 'prettier', -- or `prettierd` - filetypes = { - "css", - "graphql", - "html", - "javascript", - "javascriptreact", - "json", - "less", - "markdown", - "scss", - "typescript", - "typescriptreact", - "yaml", - }, -}) diff --git a/nivm/lua/settings/project.lua b/nivm/lua/settings/project.lua deleted file mode 100644 index 27a1329..0000000 --- a/nivm/lua/settings/project.lua +++ /dev/null @@ -1,48 +0,0 @@ -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end -project.setup({ - ---@usage set to false to disable project.nvim. - --- This is on by default since it's currently the expected behavior. - active = true, - - on_config_done = nil, - - ---@usage set to true to disable setting the current-woriking directory - --- Manual mode doesn't automatically change your root directory, so you have - --- the option to manually do so using `:ProjectRoot` command. - manual_mode = false, - - ---@usage Methods of detecting the root directory - --- Allowed values: **"lsp"** uses the native neovim lsp - --- **"pattern"** uses vim-rooter like glob pattern matching. Here - --- order matters: if one is not detected, the other is used as fallback. You - --- can also delete or rearangne the detection methods. - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - - ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - - ---@ Show hidden files in telescope when searching for files in a project - show_hidden = false, - - ---@usage When set to false, you will get a message when project.nvim changes your directory. - -- When set to false, you will get a message when project.nvim changes your directory. - silent_chdir = true, - - ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } - ignore_lsp = {}, - - ---@type string - ---@usage path to store the project history for use in telescope - datapath = vim.fn.stdpath("data"), -}) - -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension('projects') diff --git a/nivm/lua/settings/rainbow.lua b/nivm/lua/settings/rainbow.lua deleted file mode 100644 index a070e04..0000000 --- a/nivm/lua/settings/rainbow.lua +++ /dev/null @@ -1,14 +0,0 @@ -require("nvim-treesitter.configs").setup { - highlight = { - -- ... - }, - -- ... - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - } -} diff --git a/nivm/lua/settings/telescope.lua b/nivm/lua/settings/telescope.lua deleted file mode 100644 index 790836a..0000000 --- a/nivm/lua/settings/telescope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local builtin = require('telescope.builtin') -local async = require "plenary.async" -require('telescope').setup{} -require('telescope').load_extension('fzy_native') -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/nivm/lua/settings/test.log b/nivm/lua/settings/test.log deleted file mode 100644 index 1a0e222..0000000 --- a/nivm/lua/settings/test.log +++ /dev/null @@ -1,57 +0,0 @@ -** -(test.tex -LaTeX2e <2020-10-01> patch level 4 -L3 programming layer <2021-02-18> (article.cls -Document Class: article 2020/04/10 v1.4m Standard LaTeX document class -(size10.clo -File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option) -) -\c@part=\count175 -\c@section=\count176 -\c@subsection=\count177 -\c@subsubsection=\count178 -\c@paragraph=\count179 -\c@subparagraph=\count180 -\c@figure=\count181 -\c@table=\count182 -\abovecaptionskip=\skip47 -\belowcaptionskip=\skip48 -\bibindent=\dimen138 -) (l3backend-xetex.def -File: l3backend-xetex.def 2021-03-18 L3 backend support: XeTeX -\c__kernel_sys_dvipdfmx_version_int=\count183 -\l__color_backend_stack_int=\count184 -\g__color_backend_stack_int=\count185 -\g__graphics_track_int=\count186 -\l__pdf_internal_box=\box47 -\g__pdf_backend_object_int=\count187 -\g__pdf_backend_annotation_int=\count188 -\g__pdf_backend_link_int=\count189 -) (test.aux) -\openout1 = `test.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 2. -LaTeX Font Info: Trying to load font information for TS1+cmr on input line 2 -. - (ts1cmr.fd -File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. - [1 - -] (test.aux) ) -Output written on test.xdv (1 page, 624 bytes). diff --git a/nivm/lua/settings/treesitter.lua b/nivm/lua/settings/treesitter.lua deleted file mode 100644 index 7068904..0000000 --- a/nivm/lua/settings/treesitter.lua +++ /dev/null @@ -1,21 +0,0 @@ -local status_ok, _ = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "latex" , "c", "cpp" , "rust" , "lua", "haskell" , "java" , "javascript" , "typescript" }, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -} - -local status_ok2, _ = pcall(require, "spellsitter") -if not status_ok2 then - return -end - -require("spellsitter").setup() - diff --git a/nivm/lua/settings/vimtex.lua b/nivm/lua/settings/vimtex.lua deleted file mode 100644 index 9677bf0..0000000 --- a/nivm/lua/settings/vimtex.lua +++ /dev/null @@ -1,24 +0,0 @@ ---vim.cmd('let g:vimtex_view_method = "zathura"') -vim.cmd('let g:vimtex_view_general_viewer = "evince"') ---let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' - ---vim.cmd('let g:vimtex_compiler_latexmk = { "options" : [ "-shell-escape", "-interaction=nonstopmode" , "-synctex=1" ], }') - -vim.cmd('let g:vimtex_compiler_method = "latexmk"') - - ---vim.cmd('let b:tex_use_shell_escape = 1') - ---let maplocalleader = "," - - ---let g:vimtex_compiler_latexmk = { --- \ 'options' : [ --- \ '-pdf', --- \ '-shell-escape', --- \ '-verbose', --- \ '-file-line-error', --- \ '-synctex=1', --- \ '-interaction=nonstopmode', --- \ ], --- \} diff --git a/nivm/settings/autocommands.lua b/nivm/settings/autocommands.lua deleted file mode 100644 index ec7f220..0000000 --- a/nivm/settings/autocommands.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.cmd('let g:vimtex_view_general_viewer = "evince"') -vim.cmd('let g:vimtex_compiler_method = "latexmk"') diff --git a/nivm/settings/bufferline.lua b/nivm/settings/bufferline.lua deleted file mode 100644 index cdf728b..0000000 --- a/nivm/settings/bufferline.lua +++ /dev/null @@ -1,146 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator = { - style = 'icon', - }, - buffer_close_icon = "", - -- buffer_close_icon = '', - modified_icon = "●", - close_icon = "", - -- close_icon = '', - left_trunc_marker = "", - right_trunc_marker = "", - -- end, - max_name_length = 30, - max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_close_icon = true, - show_tab_indicators = false, - persist_buffer_sort = true,-- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - hover = { - enabled = true, - delay = 200, - reveal = {'close'} - }, - -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) - -- -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - }, - highlights = { - fill = { - fg = { attribute = "fg", highlight = "#ff0000" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - -- buffer_selected = { - -- guifg = {attribute='fg',highlight='#ff0000'}, - -- guibg = {attribute='bg',highlight='#0000ff'}, - -- gui = 'none' - -- }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - -- close_button_selected = { - -- guifg = {attribute='fg',highlight='TabLineSel'}, - -- guibg ={attribute='bg',highlight='TabLineSel'} - -- }, - - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - italic = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - separator_visible = { - fg = {attribute='bg',highlight='TabLine'}, - bg = {attribute='bg',highlight='TabLine'} - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, -} diff --git a/nivm/settings/cmp.lua b/nivm/settings/cmp.lua deleted file mode 100644 index ef9069a..0000000 --- a/nivm/settings/cmp.lua +++ /dev/null @@ -1,133 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -vim.cmd('let g:snipMate = {"snippet_version" : 1 }') -require("luasnip/loaders/from_vscode").lazy_load() -require("luasnip.loaders.from_snipmate").lazy_load() - -local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" -end - ---   פּ ﯟ   some other good icons -local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} --- find more here: https://www.nerdfonts.com/cheat-sheet - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = false, - native_menu = false, - }, -} diff --git a/nivm/settings/colorscheme.lua b/nivm/settings/colorscheme.lua deleted file mode 100644 index 04f4019..0000000 --- a/nivm/settings/colorscheme.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, _ = pcall(require, "nightfox") -if not status_ok then - return -end - -vim.cmd("colorscheme nightfox") diff --git a/nivm/settings/comment.lua b/nivm/settings/comment.lua deleted file mode 100644 index 2fa4a56..0000000 --- a/nivm/settings/comment.lua +++ /dev/null @@ -1,22 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup { - pre_hook = function(ctx) - local U = require "Comment.utils" - - local location = nil - if ctx.ctype == U.ctype.block then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring { - key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - location = location, - } - end, -} diff --git a/nivm/settings/cpp-dap.lua b/nivm/settings/cpp-dap.lua deleted file mode 100644 index 5f86d08..0000000 --- a/nivm/settings/cpp-dap.lua +++ /dev/null @@ -1,45 +0,0 @@ -local dap = require('dap') -dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', - command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7', -} - -dap.configurations.cpp = { - { - name = "Launch file", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = "Launch file --gui", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - args = {'--gui'}, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = 'Attach to gdbserver :1234', - type = 'cppdbg', - request = 'launch', - MIMode = 'gdb', - miDebuggerServerAddress = 'localhost:1234', - miDebuggerPath = '/usr/bin/gdb', - cwd = '${workspaceFolder}', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - }, -} - -dap.configurations.c = dap.configurations.cpp -dap.configurations.rust = dap.configurations.cpp diff --git a/nivm/settings/dap-ui.lua b/nivm/settings/dap-ui.lua deleted file mode 100644 index cbd3d24..0000000 --- a/nivm/settings/dap-ui.lua +++ /dev/null @@ -1,73 +0,0 @@ -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - } -}) -require("dapui").setup() diff --git a/nivm/settings/dap.lua b/nivm/settings/dap.lua deleted file mode 100644 index 1a26926..0000000 --- a/nivm/settings/dap.lua +++ /dev/null @@ -1,126 +0,0 @@ -local dap = require('dap') -dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', - command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7', -} - -dap.configurations.cpp = { - { - name = "Launch file", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = "Launch file --gui", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - args = {'--gui'}, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = 'Attach to gdbserver :1234', - type = 'cppdbg', - request = 'launch', - MIMode = 'gdb', - miDebuggerServerAddress = 'localhost:1234', - miDebuggerPath = '/usr/bin/gdb', - cwd = '${workspaceFolder}', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - }, -} - -dap.configurations.c = dap.configurations.cpp -dap.configurations.rust = dap.configurations.cpp - -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - } -}) -require("mason-nvim-dap").setup({ - ensure_installed = { "cpptools", - "bash-debug-adapter", - "firefox-debug-adapter", - "js-debug-adapter", - "node-debug2-adapter" - } -}) diff --git a/nivm/settings/dashboard.lua b/nivm/settings/dashboard.lua deleted file mode 100644 index 6ab1ec9..0000000 --- a/nivm/settings/dashboard.lua +++ /dev/null @@ -1,42 +0,0 @@ -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - -local dashboard = require("alpha.themes.dashboard") -dashboard.section.header.val = { -[[ _______ ___ _______. __ __ __ _______ ]], -[[| \ / \ / || | | | | | | ____|]], -[[| .--. | / ^ \ | (----`| |__| | | | | |__ ]], -[[| | | | / /_\ \ \ \ | __ | | | | __| ]], -[[| '--' | / _____ \ .----) | | | | | | | | |____ ]], -[[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]] -} -dashboard.section.buttons.val = { - dashboard.button("f", " Find file", ":Telescope find_files "), - dashboard.button("e", " New file", ":ene startinsert "), - dashboard.button("p", " Find project", ":Telescope projects "), - dashboard.button("r", " Recently used files", ":Telescope oldfiles "), - dashboard.button("t", " Find text", ":Telescope live_grep "), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " Quit Neovim", ":qa"), -} - -local function footer() --- NOTE: requires the fortune-mod package to work - -- local handle = io.popen("fortune") - -- local fortune = handle:read("*a") - -- handle:close() - -- return fortune - return "dashie@shitgaem.online" -end - -dashboard.section.footer.val = footer() - -dashboard.section.footer.opts.hl = "Type" -dashboard.section.header.opts.hl = "Include" -dashboard.section.buttons.opts.hl = "Keyword" - -dashboard.opts.opts.noautocmd = true --- vim.cmd([[autocmd User AlphaReady echo 'ready']]) -alpha.setup(dashboard.opts) diff --git a/nivm/settings/devicons.lua b/nivm/settings/devicons.lua deleted file mode 100644 index 57c1386..0000000 --- a/nivm/settings/devicons.lua +++ /dev/null @@ -1,23 +0,0 @@ -local status_ok , _ = pcall (require, "nvim-web-devicons") -if not status_ok then - return -end - - -require'nvim-web-devicons'.setup { - -- your personnal icons can go here (to override) - -- you can specify color or cterm_color instead of specifying both of them - -- DevIcon will be appended to `name` - override = { - zsh = { - icon = "", - color = "#428850", - cterm_color = "65", - name = "Zsh" - } - }; - - default = true; -} - -require'nvim-web-devicons'.get_icons() diff --git a/nivm/settings/feline.lua b/nivm/settings/feline.lua deleted file mode 100644 index afda8a9..0000000 --- a/nivm/settings/feline.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, _ = pcall(require, "feline") -if not status_ok then - return -end - - -require('feline').setup() ---require('feline').winbar.setup() diff --git a/nivm/settings/gitsigns.lua b/nivm/settings/gitsigns.lua deleted file mode 100644 index 91fa65b..0000000 --- a/nivm/settings/gitsigns.lua +++ /dev/null @@ -1 +0,0 @@ -require('gitsigns').setup() diff --git a/nivm/settings/haskell.lua b/nivm/settings/haskell.lua deleted file mode 100644 index d463870..0000000 --- a/nivm/settings/haskell.lua +++ /dev/null @@ -1,43 +0,0 @@ - -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'haskell-language-server-wrapper', '--lsp' }, - filetypes = { 'haskell', 'lhaskell' }, - root_dir = util.root_pattern('*.cabal', 'stack.yaml', 'cabal.project', 'package.yaml', 'hie.yaml'), - single_file_support = true, - settings = { - haskell = { - formattingProvider = 'ormolu', - }, - }, - lspinfo = function(cfg) - local extra = {} - local function on_stdout(_, data, _) - local version = data[1] - table.insert(extra, 'version: ' .. version) - end - - local opts = { - cwd = cfg.cwd, - stdout_buffered = true, - on_stdout = on_stdout, - } - local chanid = vim.fn.jobstart({ cfg.cmd[1], '--version' }, opts) - vim.fn.jobwait { chanid } - return extra - end, - }, - - docs = { - description = [[ -https://github.com/haskell/haskell-language-server -Haskell Language Server - ]], - - default_config = { - root_dir = [[root_pattern("*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml")]], - }, - }, -} diff --git a/nivm/settings/impatient.lua b/nivm/settings/impatient.lua deleted file mode 100644 index 84419e0..0000000 --- a/nivm/settings/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/nivm/settings/indentline.lua b/nivm/settings/indentline.lua deleted file mode 100644 index fdf5870..0000000 --- a/nivm/settings/indentline.lua +++ /dev/null @@ -1,70 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" } -vim.g.indent_blankline_filetype_exclude = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", -} -vim.g.indentLine_enabled = 1 --- vim.g.indent_blankline_char = "│" -vim.g.indent_blankline_char = "▏" --- vim.g.indent_blankline_char = "▎" -vim.g.indent_blankline_show_trailing_blankline_indent = false -vim.g.indent_blankline_show_first_indent_level = true -vim.g.indent_blankline_use_treesitter = true -vim.g.indent_blankline_show_current_context = true -vim.g.indent_blankline_context_patterns = { - "class", - "return", - "function", - "method", - "^if", - "^while", - "jsx_element", - "^for", - "^object", - "^table", - "block", - "arguments", - "if_statement", - "else_clause", - "jsx_element", - "jsx_self_closing_element", - "try_statement", - "catch_clause", - "import_statement", - "operation_type", -} --- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59 -vim.wo.colorcolumn = "99999" - --- vim.cmd [[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]] --- vim.cmd [[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]] --- vim.opt.list = true --- vim.opt.listchars:append "space:⋅" --- vim.opt.listchars:append "space:" --- vim.opt.listchars:append "eol:↴" - -indent_blankline.setup({ - -- show_end_of_line = true, - -- space_char_blankline = " ", - show_current_context = true, - -- show_current_context_start = true, - -- char_highlight_list = { - -- "IndentBlanklineIndent1", - -- "IndentBlanklineIndent2", - -- "IndentBlanklineIndent3", - -- }, -}) diff --git a/nivm/settings/keymaps.lua b/nivm/settings/keymaps.lua deleted file mode 100644 index f1f6ae3..0000000 --- a/nivm/settings/keymaps.lua +++ /dev/null @@ -1,23 +0,0 @@ -local opts = { noremap = true, silent = true } - -local term_opts = { silent = true } - --- Shorten function name -local keymap = vim.api.nvim_set_keymap - - -keymap("n", "c", ":CodeActionMenu", opts) -keymap("n", "", ':lua require("dap").toggle_breakpoint()', opts) -keymap("n", "", ':lua require("dap").step_over()', opts) -keymap("n", "", ':lua require("dap").step_into()', opts) -keymap("n", "", ':lua require("dap").continue()', opts) -keymap("n", "", ':lua require("dap").close() :lua require("dapui").toggle()', opts) -keymap("n", "", ':lua require("dap").continue() :lua require("dapui").toggle()', opts) - -keymap("n", "t", ':lua require("nvim-tree").toggle()', opts) -keymap("n", "f", ':lua require("nvim-tree").focus()', opts) - -keymap("n", "", ':BufferLineMoveNext', opts) -keymap("n", "", ':BufferLineMovePrev', opts) - -keymap("n", "", ':lua vim.lsp.buf.format { async = true }', opts) diff --git a/nivm/settings/lint.lua b/nivm/settings/lint.lua deleted file mode 100644 index ad45d4c..0000000 --- a/nivm/settings/lint.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('lint').linters_by_ft = { - javascript = {'eslint',}, - react = {'eslint',}, -} diff --git a/nivm/settings/lsp.lua b/nivm/settings/lsp.lua deleted file mode 100644 index beddafb..0000000 --- a/nivm/settings/lsp.lua +++ /dev/null @@ -1,158 +0,0 @@ -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - return -end - -require("mason").setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } -}) - -require("mason-lspconfig").setup({ - ensure_installed = { - "cssls", -- css - "html", -- html - "eslint", -- latex - "clangd", -- cpp / c - "tsserver", -- python - "texlab", -- latex - "sumneko_lua", -- lua - "pyright", -- python - "rust_analyzer", -- rust - "jdtls", -- jdtls - "cmake", -- cmake - "bashls", -- shell - "ansiblels", -- ansible - "csharp_ls", -- dotnot - "hls" -- haskel - }, - automatic_installation = true -}) - -require('lspconfig')['cssls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['html'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['eslint'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['clangd'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['tsserver'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['texlab'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['sumneko_lua'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['pyright'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['rust_analyzer'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['jdtls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['cmake'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['bashls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['ansiblels'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['csharp_ls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['hls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - - - - - ---local status_ok2, lsp_installer = pcall(require, "mason") ---if not status_ok2 then --- return ---end --- ---local servers = {"jdtls" , "sumneko_lua" , "texlab", "pyright" , "eslint_d" , "html" , "cssls" , "rust_analyzer" , "bashls" , "csharp_ls" , "sqls" , "clangd" } --- ---lsp_installer.setup { --- ensure_installed = servers ---} --- ---for _, server in pairs(servers) do --- local opts = { --- on_attach = require("settings.lsp_config.handlers").on_attach, --- capabilities = require("settings.lsp_config.handlers").capabilities, --- } --- local has_custom_opts, server_custom_opts = pcall(require, "settings.lsp_config." .. server) --- if has_custom_opts then --- opts = vim.tbl_deep_extend("force", server_custom_opts, opts) --- end --- lspconfig[server].setup(opts) ---end --- --- ---local null_ls_status_ok, null_ls = pcall(require, "null-ls") ---if not null_ls_status_ok then --- return ---end --- ----- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting ---local formatting = null_ls.builtins.formatting ----- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics ---local diagnostics = null_ls.builtins.diagnostics --- ---null_ls.setup({ --- debug = false, --- sources = { --- formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), --- formatting.black.with({ extra_args = { "--fast" } }), --- formatting.stylua, --- -- diagnostics.flake8 --- }, ---}) diff --git a/nivm/settings/lsp_config/bashls.lua b/nivm/settings/lsp_config/bashls.lua deleted file mode 100644 index e2392e4..0000000 --- a/nivm/settings/lsp_config/bashls.lua +++ /dev/null @@ -1,37 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'bash-language-server' -local cmd = { bin_name, 'start' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, 'start' } -end - -return { - default_config = { - cmd = cmd, - cmd_env = { - -- Prevent recursive scanning which will cause issues when opening a file - -- directly in the home directory (e.g. ~/foo.sh). - -- - -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". - GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', - }, - filetypes = { 'sh' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - }, - docs = { - description = [[ -https://github.com/mads-hartmann/bash-language-server -`bash-language-server` can be installed via `npm`: -```sh -npm i -g bash-language-server -``` -Language server for bash, written using tree sitter in typescript. -]], - default_config = { - root_dir = [[util.find_git_ancestor]], - }, - }, -} diff --git a/nivm/settings/lsp_config/clangd.lua b/nivm/settings/lsp_config/clangd.lua deleted file mode 100644 index 65da8c0..0000000 --- a/nivm/settings/lsp_config/clangd.lua +++ /dev/null @@ -1,87 +0,0 @@ -local util = require 'lspconfig.util' - --- https://clangd.llvm.org/extensions.html#switch-between-sourceheader -local function switch_source_header(bufnr) - bufnr = util.validate_bufnr(bufnr) - local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') - local params = { uri = vim.uri_from_bufnr(bufnr) } - if clangd_client then - clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) - if err then - error(tostring(err)) - end - if not result then - print 'Corresponding file cannot be determined' - return - end - vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) - end, bufnr) - else - print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' - end -end - -local root_files = { - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', -- AutoTools -} - -local default_capabilities = { - textDocument = { - completion = { - editsNearCursor = true, - }, - }, - offsetEncoding = { 'utf-8', 'utf-16' }, -} - -return { - default_config = { - cmd = { 'clangd' }, - filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, - root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) - end, - single_file_support = true, - capabilities = default_capabilities, - }, - commands = { - ClangdSwitchSourceHeader = { - function() - switch_source_header(0) - end, - description = 'Switch between source/header', - }, - }, - docs = { - description = [[ -https://clangd.llvm.org/installation.html -- **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lsp/issues/23). -- If `compile_commands.json` lives in a build directory, you should - symlink it to the root of your source tree. - ``` - ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ - ``` -- clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) - specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson -]], - default_config = { - root_dir = [[ - root_pattern( - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_commands.json', - 'compile_flags.txt', - 'configure.ac', - '.git' - ) - ]], - capabilities = [[default capabilities, with offsetEncoding utf-8]], - }, - }, -} diff --git a/nivm/settings/lsp_config/csharp_ls.lua b/nivm/settings/lsp_config/csharp_ls.lua deleted file mode 100644 index a03a25b..0000000 --- a/nivm/settings/lsp_config/csharp_ls.lua +++ /dev/null @@ -1,20 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'csharp-ls' }, - root_dir = util.root_pattern('*.sln', '*.csproj', '*.fsproj', '.git'), - filetypes = { 'cs' }, - init_options = { - AutomaticWorkspaceInit = true, - }, - }, - docs = { - description = [[ -https://github.com/razzmatazz/csharp-language-server -Language Server for C#. -csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. -The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. - ]], - }, -} diff --git a/nivm/settings/lsp_config/cssls.lua b/nivm/settings/lsp_config/cssls.lua deleted file mode 100644 index d1b7aa6..0000000 --- a/nivm/settings/lsp_config/cssls.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-css-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'css', 'scss', 'less' }, - root_dir = util.root_pattern('package.json', '.git'), - single_file_support = true, - settings = { - css = { validate = true }, - scss = { validate = true }, - less = { validate = true }, - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`css-languageserver` can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. -```lua ---Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.cssls.setup { - capabilities = capabilities, -} -``` -]], - default_config = { - root_dir = [[root_pattern("package.json", ".git") or bufdir]], - }, - }, -} diff --git a/nivm/settings/lsp_config/eslint.lua b/nivm/settings/lsp_config/eslint.lua deleted file mode 100644 index d456970..0000000 --- a/nivm/settings/lsp_config/eslint.lua +++ /dev/null @@ -1,165 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local function fix_all(opts) - opts = opts or {} - - local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') - if eslint_lsp_client == nil then - return - end - - local request - if opts.sync then - request = function(bufnr, method, params) - eslint_lsp_client.request_sync(method, params, nil, bufnr) - end - else - request = function(bufnr, method, params) - eslint_lsp_client.request(method, params, nil, bufnr) - end - end - - local bufnr = util.validate_bufnr(opts.bufnr or 0) - request(0, 'workspace/executeCommand', { - command = 'eslint.applyAllFixes', - arguments = { - { - uri = vim.uri_from_bufnr(bufnr), - version = lsp.util.buf_versions[bufnr], - }, - }, - }) -end - -local bin_name = 'vscode-eslint-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - }, - -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - root_dir = util.root_pattern( - '.eslintrc', - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'package.json' - ), - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - packageManager = 'npm', - useESLintClass = false, - codeActionOnSave = { - enable = false, - mode = 'all', - }, - format = true, - quiet = false, - onIgnoredFiles = 'off', - rulesCustomizations = {}, - run = 'onType', - -- nodePath configures the directory in which the eslint server should start its node_modules resolution. - -- This path is relative to the workspace folder (root dir) of the server instance. - nodePath = '', - -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory - workingDirectory = { mode = 'location' }, - codeAction = { - disableRuleComment = { - enable = true, - location = 'separateLine', - }, - showDocumentation = { - enable = true, - }, - }, - }, - on_new_config = function(config, new_root_dir) - -- The "workspaceFolder" is a VSCode concept. It limits how far the - -- server will traverse the file system when locating the ESLint config - -- file (e.g., .eslintrc). - config.settings.workspaceFolder = { - uri = new_root_dir, - name = vim.fn.fnamemodify(new_root_dir, ':t'), - } - - -- Support Yarn2 (PnP) projects - local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') - local pnp_js = util.path.join(new_root_dir, '.pnp.js') - if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then - config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) - end - end, - handlers = { - ['eslint/openDoc'] = function(_, result) - if not result then - return - end - local sysname = vim.loop.os_uname().sysname - if sysname:match 'Windows' then - os.execute(string.format('start %q', result.url)) - elseif sysname:match 'Linux' then - os.execute(string.format('xdg-open %q', result.url)) - else - os.execute(string.format('open %q', result.url)) - end - return {} - end, - ['eslint/confirmESLintExecution'] = function(_, result) - if not result then - return - end - return 4 -- approved - end, - ['eslint/probeFailed'] = function() - vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) - return {} - end, - ['eslint/noLibrary'] = function() - vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) - return {} - end, - }, - }, - commands = { - EslintFixAll = { - function() - fix_all { sync = true, bufnr = 0 } - end, - description = 'Fix all eslint problems for this buffer', - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. -It can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. -Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` -Additional messages you can handle: `eslint/noConfig` -]], - }, -} diff --git a/nivm/settings/lsp_config/eslint_d.lua b/nivm/settings/lsp_config/eslint_d.lua deleted file mode 100644 index d456970..0000000 --- a/nivm/settings/lsp_config/eslint_d.lua +++ /dev/null @@ -1,165 +0,0 @@ -local util = require 'lspconfig.util' -local lsp = vim.lsp - -local function fix_all(opts) - opts = opts or {} - - local eslint_lsp_client = util.get_active_client_by_name(opts.bufnr, 'eslint') - if eslint_lsp_client == nil then - return - end - - local request - if opts.sync then - request = function(bufnr, method, params) - eslint_lsp_client.request_sync(method, params, nil, bufnr) - end - else - request = function(bufnr, method, params) - eslint_lsp_client.request(method, params, nil, bufnr) - end - end - - local bufnr = util.validate_bufnr(opts.bufnr or 0) - request(0, 'workspace/executeCommand', { - command = 'eslint.applyAllFixes', - arguments = { - { - uri = vim.uri_from_bufnr(bufnr), - version = lsp.util.buf_versions[bufnr], - }, - }, - }) -end - -local bin_name = 'vscode-eslint-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - }, - -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - root_dir = util.root_pattern( - '.eslintrc', - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'package.json' - ), - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - packageManager = 'npm', - useESLintClass = false, - codeActionOnSave = { - enable = false, - mode = 'all', - }, - format = true, - quiet = false, - onIgnoredFiles = 'off', - rulesCustomizations = {}, - run = 'onType', - -- nodePath configures the directory in which the eslint server should start its node_modules resolution. - -- This path is relative to the workspace folder (root dir) of the server instance. - nodePath = '', - -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory - workingDirectory = { mode = 'location' }, - codeAction = { - disableRuleComment = { - enable = true, - location = 'separateLine', - }, - showDocumentation = { - enable = true, - }, - }, - }, - on_new_config = function(config, new_root_dir) - -- The "workspaceFolder" is a VSCode concept. It limits how far the - -- server will traverse the file system when locating the ESLint config - -- file (e.g., .eslintrc). - config.settings.workspaceFolder = { - uri = new_root_dir, - name = vim.fn.fnamemodify(new_root_dir, ':t'), - } - - -- Support Yarn2 (PnP) projects - local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs') - local pnp_js = util.path.join(new_root_dir, '.pnp.js') - if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then - config.cmd = vim.list_extend({ 'yarn', 'exec' }, cmd) - end - end, - handlers = { - ['eslint/openDoc'] = function(_, result) - if not result then - return - end - local sysname = vim.loop.os_uname().sysname - if sysname:match 'Windows' then - os.execute(string.format('start %q', result.url)) - elseif sysname:match 'Linux' then - os.execute(string.format('xdg-open %q', result.url)) - else - os.execute(string.format('open %q', result.url)) - end - return {} - end, - ['eslint/confirmESLintExecution'] = function(_, result) - if not result then - return - end - return 4 -- approved - end, - ['eslint/probeFailed'] = function() - vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) - return {} - end, - ['eslint/noLibrary'] = function() - vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) - return {} - end, - }, - }, - commands = { - EslintFixAll = { - function() - fix_all { sync = true, bufnr = 0 } - end, - description = 'Fix all eslint problems for this buffer', - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. -It can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -`vscode-eslint-language-server` provides an `EslintFixAll` command that can be used to format a document on save: -```vim -autocmd BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll -``` -See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. -Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` -Additional messages you can handle: `eslint/noConfig` -]], - }, -} diff --git a/nivm/settings/lsp_config/handlers.lua b/nivm/settings/lsp_config/handlers.lua deleted file mode 100644 index 5695f84..0000000 --- a/nivm/settings/lsp_config/handlers.lua +++ /dev/null @@ -1,100 +0,0 @@ -local M = {} - --- TODO: backfill this to template -M.setup = function() - local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end - - local config = { - -- disable virtual text - virtual_text = false, - -- show signs - signs = { - active = signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - } - - vim.diagnostic.config(config) - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", - }) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "rounded", - }) -end - -local function lsp_highlight_document(client) - -- Set autocommands conditional on server_capabilities - local status_ok, illuminate = pcall(require, "illuminate") - if not status_ok then - return - end - illuminate.on_attach(client) - -- end -end - -local function lsp_keymaps(bufnr) - local opts = { noremap = true, silent = true } - vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "rn", "lua vim.lsp.buf.rename()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "ca", "lua vim.lsp.buf.code_action()", opts) - -- vim.api.nvim_buf_set_keymap(bufnr, "n", "f", "lua vim.diagnostic.open_float()", opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) - vim.api.nvim_buf_set_keymap( - bufnr, - "n", - "gl", - 'lua vim.diagnostic.open_float({ border = "rounded" })', - opts - ) - vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) - vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) - vim.cmd [[ command! Format execute 'lua vim.lsp.buf.format { async = true }' ]] -end - -M.on_attach = function(client, bufnr) - -- vim.notify(client.name .. " starting...") - -- TODO: refactor this into a method that checks if string in list - if client.name == "tsserver" then - client.resolved_capabilities.document_formatting = false - end - lsp_keymaps(bufnr) - lsp_highlight_document(client) -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() - -local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not status_ok then - return -end - -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) - -return M diff --git a/nivm/settings/lsp_config/html.lua b/nivm/settings/lsp_config/html.lua deleted file mode 100644 index b1771d3..0000000 --- a/nivm/settings/lsp_config/html.lua +++ /dev/null @@ -1,43 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'vscode-html-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'html' }, - root_dir = util.root_pattern('package.json', '.git'), - single_file_support = true, - settings = {}, - init_options = { - provideFormatter = true, - embeddedLanguages = { css = true, javascript = true }, - configurationSection = { 'html', 'css', 'javascript' }, - }, - }, - docs = { - description = [[ -https://github.com/hrsh7th/vscode-langservers-extracted -`vscode-html-language-server` can be installed via `npm`: -```sh -npm i -g vscode-langservers-extracted -``` -Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. -To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. -The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. -```lua ---Enable (broadcasting) snippet capability for completion -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities.textDocument.completion.completionItem.snippetSupport = true -require'lspconfig'.html.setup { - capabilities = capabilities, -} -``` -]], - }, -} diff --git a/nivm/settings/lsp_config/jdtls.lua b/nivm/settings/lsp_config/jdtls.lua deleted file mode 100644 index 1254f9b..0000000 --- a/nivm/settings/lsp_config/jdtls.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - settings = { - - java = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} - diff --git a/nivm/settings/lsp_config/pyright.lua b/nivm/settings/lsp_config/pyright.lua deleted file mode 100644 index 16513cc..0000000 --- a/nivm/settings/lsp_config/pyright.lua +++ /dev/null @@ -1,55 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'pyright-langserver' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -local root_files = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', - 'pyrightconfig.json', -} - -local function organize_imports() - local params = { - command = 'pyright.organizeimports', - arguments = { vim.uri_from_bufnr(0) }, - } - vim.lsp.buf.execute_command(params) -end - -return { - default_config = { - cmd = cmd, - filetypes = { 'python' }, - root_dir = util.root_pattern(unpack(root_files)), - single_file_support = true, - settings = { - python = { - analysis = { - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = 'workspace', - }, - }, - }, - }, - commands = { - PyrightOrganizeImports = { - organize_imports, - description = 'Organize Imports', - }, - }, - docs = { - description = [[ -https://github.com/microsoft/pyright -`pyright`, a static type checker and language server for python -]], - }, -} diff --git a/nivm/settings/lsp_config/rust_analyzer.lua b/nivm/settings/lsp_config/rust_analyzer.lua deleted file mode 100644 index bc85596..0000000 --- a/nivm/settings/lsp_config/rust_analyzer.lua +++ /dev/null @@ -1,77 +0,0 @@ -local util = require 'lspconfig.util' - -local function reload_workspace(bufnr) - bufnr = util.validate_bufnr(bufnr) - vim.lsp.buf_request(bufnr, 'rust-analyzer/reloadWorkspace', nil, function(err) - if err then - error(tostring(err)) - end - vim.notify 'Cargo workspace reloaded' - end) -end - -return { - default_config = { - cmd = { 'rust-analyzer' }, - filetypes = { 'rust' }, - root_dir = function(fname) - local cargo_crate_dir = util.root_pattern 'Cargo.toml'(fname) - local cmd = { 'cargo', 'metadata', '--no-deps', '--format-version', '1' } - if cargo_crate_dir ~= nil then - cmd[#cmd + 1] = '--manifest-path' - cmd[#cmd + 1] = util.path.join(cargo_crate_dir, 'Cargo.toml') - end - local cargo_metadata = '' - local cargo_metadata_err = '' - local cm = vim.fn.jobstart(cmd, { - on_stdout = function(_, d, _) - cargo_metadata = table.concat(d, '\n') - end, - on_stderr = function(_, d, _) - cargo_metadata_err = table.concat(d, '\n') - end, - stdout_buffered = true, - stderr_buffered = true, - }) - if cm > 0 then - cm = vim.fn.jobwait({ cm })[1] - else - cm = -1 - end - local cargo_workspace_dir = nil - if cm == 0 then - cargo_workspace_dir = vim.json.decode(cargo_metadata)['workspace_root'] - else - vim.notify( - string.format('[lspconfig] cmd (%q) failed:\n%s', table.concat(cmd, ' '), cargo_metadata_err), - vim.log.levels.WARN - ) - end - return util.path.sanitize(cargo_workspace_dir) - or cargo_crate_dir - or util.root_pattern 'rust-project.json'(fname) - or util.find_git_ancestor(fname) - end, - settings = { - ['rust-analyzer'] = {}, - }, - }, - commands = { - CargoReload = { - function() - reload_workspace(0) - end, - description = 'Reload current cargo workspace', - }, - }, - docs = { - description = [[ -https://github.com/rust-analyzer/rust-analyzer -rust-analyzer (aka rls 2.0), a language server for Rust -See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user#settings) for extra settings. - ]], - default_config = { - root_dir = [[root_pattern("Cargo.toml", "rust-project.json")]], - }, - }, -} diff --git a/nivm/settings/lsp_config/sqls.lua b/nivm/settings/lsp_config/sqls.lua deleted file mode 100644 index bdbf27b..0000000 --- a/nivm/settings/lsp_config/sqls.lua +++ /dev/null @@ -1,23 +0,0 @@ -local util = require 'lspconfig.util' - -return { - default_config = { - cmd = { 'sqls' }, - filetypes = { 'sql', 'mysql' }, - root_dir = util.root_pattern 'config.yml', - single_file_support = true, - settings = {}, - }, - docs = { - description = [[ -https://github.com/lighttiger2505/sqls -```lua -require'lspconfig'.sqls.setup{ - cmd = {"path/to/command", "-config", "path/to/config.yml"}; - ... -} -``` -Sqls can be installed via `go get github.com/lighttiger2505/sqls`. Instructions for compiling Sqls from the source can be found at [lighttiger2505/sqls](https://github.com/lighttiger2505/sqls). - ]], - }, -} diff --git a/nivm/settings/lsp_config/sumneko_lua.lua b/nivm/settings/lsp_config/sumneko_lua.lua deleted file mode 100644 index 0ac454a..0000000 --- a/nivm/settings/lsp_config/sumneko_lua.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/nivm/settings/lsp_config/texlab.lua b/nivm/settings/lsp_config/texlab.lua deleted file mode 100644 index be0e199..0000000 --- a/nivm/settings/lsp_config/texlab.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - - latex = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/nivm/settings/lsp_config/tsserver.lua b/nivm/settings/lsp_config/tsserver.lua deleted file mode 100644 index 0af4cb6..0000000 --- a/nivm/settings/lsp_config/tsserver.lua +++ /dev/null @@ -1,56 +0,0 @@ -local util = require 'lspconfig.util' - -local bin_name = 'typescript-language-server' -local cmd = { bin_name, '--stdio' } - -if vim.fn.has 'win32' == 1 then - cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } -end - -return { - default_config = { - init_options = { hostInfo = 'neovim' }, - cmd = cmd, - filetypes = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - }, - root_dir = function(fname) - return util.root_pattern 'tsconfig.json'(fname) - or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) - end, - }, - docs = { - description = [[ -https://github.com/theia-ide/typescript-language-server -`typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: -```sh -npm install -g typescript typescript-language-server -``` -To configure typescript language server, add a -[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or -[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your -project. -Here's an example that disables type checking in JavaScript files. -```json -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "checkJs": false - }, - "exclude": [ - "node_modules" - ] -} -``` -]], - default_config = { - root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], - }, - }, -} diff --git a/nivm/settings/lua_codeactions.lua b/nivm/settings/lua_codeactions.lua deleted file mode 100644 index 1d24ff5..0000000 --- a/nivm/settings/lua_codeactions.lua +++ /dev/null @@ -1,14 +0,0 @@ -local M = {} - -local lsp_util = vim.lsp.util - -function M.code_action_listener() - local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } - local params = lsp_util.make_range_params() - params.context = context - vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result) - -- do something with result - e.g. check if empty and show some indication such as a sign - end) -end - -return M diff --git a/nivm/settings/null-ls.lua b/nivm/settings/null-ls.lua deleted file mode 100644 index 5f33860..0000000 --- a/nivm/settings/null-ls.lua +++ /dev/null @@ -1,44 +0,0 @@ -local null_ls = require("null-ls") - -require("mason-null-ls").setup({ - ensure_installed = { - "prettier", - "clang_format", - "latexindent", - "shellharden", - "sql_formatter", - "fixjson", - "autopep8", - "stylua", - "rustfmt", - "stylish-haskell", - }, -}) - -null_ls.setup({ - on_attach = function(client, bufnr) - if client.server_capabilities.documentFormattingProvider then - vim.cmd("nnoremap f :lua vim.lsp.buf.format { async = true }") - - -- format on save - vim.cmd("autocmd BufWritePost lua vim.lsp.buf.format { async = true }") - end - - if client.server_capabilities.documentRangeFormattingProvider then - vim.cmd("xnoremap f :lua vim.lsp.buf.range_formatting({})") - end - end, - sources = { - require("null-ls").builtins.completion.spell, - require("null-ls").builtins.formatting.prettier, - require("null-ls").builtins.formatting.clang_format, - require("null-ls").builtins.formatting.latexindent, - require("null-ls").builtins.formatting.shellharden, - require("null-ls").builtins.formatting.sql_formatter, - require("null-ls").builtins.formatting.fixjson, - require("null-ls").builtins.formatting.autopep8, - require("null-ls").builtins.formatting.stylua, - require("null-ls").builtins.formatting.rustfmt, - require("null-ls").builtins.formatting.stylish_haskell, - }, -}) diff --git a/nivm/settings/nvim-tree.lua b/nivm/settings/nvim-tree.lua deleted file mode 100644 index c995d02..0000000 --- a/nivm/settings/nvim-tree.lua +++ /dev/null @@ -1,233 +0,0 @@ --- following options are the default --- each of these are documented in `:help nvim-tree.OPTION_NAME` - -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - --- Replaces auto_close ---local tree_cb = nvim_tree_config.nvim_tree_callback ---vim.api.nvim_create_autocmd("BufEnter", { --- nested = true, --- callback = function() --- if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then --- vim.cmd "quit" --- end --- end ---}) - - -nvim_tree.setup { -- BEGIN_DEFAULT_OPTS - auto_reload_on_write = true, - create_in_closed_folder = false, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - ignore_buffer_on_setup = false, - open_on_setup = true, - open_on_setup_file = true, - open_on_tab = true, - ignore_buf_on_tab_change = {}, - sort_by = "name", - root_dirs = {}, - prefer_startup_root = false, - sync_root_with_cwd = false, - reload_on_bufenter = false, - respect_buf_cwd = false, - on_attach = "disable", -- function(bufnr). If nil, will use the deprecated mapping strategy - remove_keymaps = false, -- boolean (disable totally or not) or list of key (lhs) - view = { - adaptive_size = false, - centralize_selection = false, - width = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - -- @deprecated - mappings = { - custom_only = false, - list = { - -- user mappings go here - }, - }, - float = { - enable = false, - open_win_config = { - relative = "editor", - border = "rounded", - width = 30, - height = 30, - row = 1, - col = 1, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - root_folder_modifier = ":~", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, - icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - bookmark = "", - folder = { - arrow_closed = "", - arrow_open = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌", - }, - }, - }, - special_files = { "cargo.toml", "makefile", "readme.md", "readme.md" }, - symlink_destination = true, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = false, - update_root = false, - ignore_list = {}, - }, - ignore_ft_on_setup = {}, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - debounce_delay = 50, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - filters = { - dotfiles = false, - custom = {}, - exclude = {}, - }, - filesystem_watchers = { - enable = true, - debounce_delay = 50, - }, - git = { - enable = true, - ignore = true, - show_on_dirs = true, - timeout = 400, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - expand_all = { - max_folder_discovery = 300, - exclude = {}, - }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, - }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { - enable = true, - chars = "abcdefghijklmnopqrstuvwxyz1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - remove_file = { - close_window = true, - }, - }, - trash = { - cmd = "gio trash", - require_confirm = true, - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, - }, - }, - } - -vim.g.nvim_tree_group_empty = 1 diff --git a/nivm/settings/options.lua b/nivm/settings/options.lua deleted file mode 100644 index 047d1c5..0000000 --- a/nivm/settings/options.lua +++ /dev/null @@ -1,33 +0,0 @@ -local options = { - clipboard = "unnamedplus", - mouse = "a", - fileencoding = "utf-8", - relativenumber = true, - smartindent = true, - smartcase = true, - showmode = true, - termguicolors = true, --- winbar = "", - ignorecase = true, - showtabline = 2, - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default) - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, - scrolloff = 8, -- is one of my fav - sidescrolloff = 8, - spell = true, - spelllang = "en_us", - mousemodel = "popup_setpos", -} - ---vim.opt.shortmess:append "c" - -for k, v in pairs(options) do - vim.opt[k] = v -end - - diff --git a/nivm/settings/pairs.lua b/nivm/settings/pairs.lua deleted file mode 100644 index 577e571..0000000 --- a/nivm/settings/pairs.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/nivm/settings/plugins.lua b/nivm/settings/plugins.lua deleted file mode 100644 index 0c1a96f..0000000 --- a/nivm/settings/plugins.lua +++ /dev/null @@ -1,54 +0,0 @@ -local Plug = vim.fn['plug#'] -vim.call('plug#begin', '~/.config/nvim/plugged') -Plug 'folke/twilight.nvim' -Plug 'nvim-lua/popup.nvim' -- An implementation of the Popup API from vim in Neovim -Plug 'nvim-lua/plenary.nvim' -- Useful lua functions used ny lots of plugins -Plug 'EdenEast/nightfox.nvim' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'feline-nvim/feline.nvim' -Plug 'lewis6991/gitsigns.nvim' -Plug 'tanvirtin/vgit.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'b3nj5m1n/kommentary' -Plug 'antoinemadec/FixCursorHold.nvim' -Plug 'lambdalisue/fern.vim' -Plug "williamboman/mason.nvim" -Plug "williamboman/mason-lspconfig.nvim" -Plug 'neovim/nvim-lspconfig' -Plug 'jose-elias-alvarez/null-ls.nvim' -Plug 'jayp0521/mason-null-ls.nvim' -Plug 'mfussenegger/nvim-dap' -Plug 'rcarriga/nvim-dap-ui' -Plug 'theHamsta/nvim-dap-virtual-text' -Plug 'jayp0521/mason-nvim-dap.nvim' -Plug('nvim-treesitter/nvim-treesitter', { ['do'] = vim.fn[':TSUpdate'] }) -Plug 'hrsh7th/nvim-cmp' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'saadparwaiz1/cmp_luasnip' -Plug 'L3MON4D3/LuaSnip' -Plug 'MarcWeber/vim-addon-mw-utils' -Plug 'tomtom/tlib_vim' -Plug 'garbas/vim-snipmate' -Plug 'kyazdani42/nvim-tree.lua' -Plug 'windwp/nvim-autopairs' -Plug 'akinsho/bufferline.nvim' -Plug 'numToStr/Comment.nvim' -Plug 'lukas-reineke/indent-blankline.nvim' -Plug 'lewis6991/impatient.nvim' -Plug 'lewis6991/spellsitter.nvim' -Plug 'moll/vim-bbye' -Plug 'nvim-telescope/telescope.nvim' -Plug 'ahmedkhalf/project.nvim' -Plug 'goolord/alpha-nvim' -Plug 'lervag/vimtex' -Plug 'weilbith/nvim-code-action-menu' -Plug 'MunifTanjim/prettier.nvim' -Plug 'rafamadriz/friendly-snippets' -Plug 'p00f/nvim-ts-rainbow' -Plug 'nvim-telescope/telescope-ui-select.nvim' -Plug 'nvim-telescope/telescope-file-browser.nvim' -Plug 'nvim-telescope/telescope-fzy-native.nvim' -vim.call('plug#end') diff --git a/nivm/settings/prettier.lua b/nivm/settings/prettier.lua deleted file mode 100644 index 91e8bb5..0000000 --- a/nivm/settings/prettier.lua +++ /dev/null @@ -1,19 +0,0 @@ -local prettier = require("prettier") - -prettier.setup({ - bin = 'prettier', -- or `prettierd` - filetypes = { - "css", - "graphql", - "html", - "javascript", - "javascriptreact", - "json", - "less", - "markdown", - "scss", - "typescript", - "typescriptreact", - "yaml", - }, -}) diff --git a/nivm/settings/project.lua b/nivm/settings/project.lua deleted file mode 100644 index 27a1329..0000000 --- a/nivm/settings/project.lua +++ /dev/null @@ -1,48 +0,0 @@ -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end -project.setup({ - ---@usage set to false to disable project.nvim. - --- This is on by default since it's currently the expected behavior. - active = true, - - on_config_done = nil, - - ---@usage set to true to disable setting the current-woriking directory - --- Manual mode doesn't automatically change your root directory, so you have - --- the option to manually do so using `:ProjectRoot` command. - manual_mode = false, - - ---@usage Methods of detecting the root directory - --- Allowed values: **"lsp"** uses the native neovim lsp - --- **"pattern"** uses vim-rooter like glob pattern matching. Here - --- order matters: if one is not detected, the other is used as fallback. You - --- can also delete or rearangne the detection methods. - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - - ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - - ---@ Show hidden files in telescope when searching for files in a project - show_hidden = false, - - ---@usage When set to false, you will get a message when project.nvim changes your directory. - -- When set to false, you will get a message when project.nvim changes your directory. - silent_chdir = true, - - ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } - ignore_lsp = {}, - - ---@type string - ---@usage path to store the project history for use in telescope - datapath = vim.fn.stdpath("data"), -}) - -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension('projects') diff --git a/nivm/settings/rainbow.lua b/nivm/settings/rainbow.lua deleted file mode 100644 index a070e04..0000000 --- a/nivm/settings/rainbow.lua +++ /dev/null @@ -1,14 +0,0 @@ -require("nvim-treesitter.configs").setup { - highlight = { - -- ... - }, - -- ... - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - } -} diff --git a/nivm/settings/telescope.lua b/nivm/settings/telescope.lua deleted file mode 100644 index 790836a..0000000 --- a/nivm/settings/telescope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local builtin = require('telescope.builtin') -local async = require "plenary.async" -require('telescope').setup{} -require('telescope').load_extension('fzy_native') -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/nivm/settings/test.log b/nivm/settings/test.log deleted file mode 100644 index 1a0e222..0000000 --- a/nivm/settings/test.log +++ /dev/null @@ -1,57 +0,0 @@ -** -(test.tex -LaTeX2e <2020-10-01> patch level 4 -L3 programming layer <2021-02-18> (article.cls -Document Class: article 2020/04/10 v1.4m Standard LaTeX document class -(size10.clo -File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option) -) -\c@part=\count175 -\c@section=\count176 -\c@subsection=\count177 -\c@subsubsection=\count178 -\c@paragraph=\count179 -\c@subparagraph=\count180 -\c@figure=\count181 -\c@table=\count182 -\abovecaptionskip=\skip47 -\belowcaptionskip=\skip48 -\bibindent=\dimen138 -) (l3backend-xetex.def -File: l3backend-xetex.def 2021-03-18 L3 backend support: XeTeX -\c__kernel_sys_dvipdfmx_version_int=\count183 -\l__color_backend_stack_int=\count184 -\g__color_backend_stack_int=\count185 -\g__graphics_track_int=\count186 -\l__pdf_internal_box=\box47 -\g__pdf_backend_object_int=\count187 -\g__pdf_backend_annotation_int=\count188 -\g__pdf_backend_link_int=\count189 -) (test.aux) -\openout1 = `test.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 2. -LaTeX Font Info: Trying to load font information for TS1+cmr on input line 2 -. - (ts1cmr.fd -File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions -) -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. - [1 - -] (test.aux) ) -Output written on test.xdv (1 page, 624 bytes). diff --git a/nivm/settings/treesitter.lua b/nivm/settings/treesitter.lua deleted file mode 100644 index 7068904..0000000 --- a/nivm/settings/treesitter.lua +++ /dev/null @@ -1,21 +0,0 @@ -local status_ok, _ = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "latex" , "c", "cpp" , "rust" , "lua", "haskell" , "java" , "javascript" , "typescript" }, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -} - -local status_ok2, _ = pcall(require, "spellsitter") -if not status_ok2 then - return -end - -require("spellsitter").setup() - diff --git a/nivm/settings/vimtex.lua b/nivm/settings/vimtex.lua deleted file mode 100644 index 9677bf0..0000000 --- a/nivm/settings/vimtex.lua +++ /dev/null @@ -1,24 +0,0 @@ ---vim.cmd('let g:vimtex_view_method = "zathura"') -vim.cmd('let g:vimtex_view_general_viewer = "evince"') ---let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' - ---vim.cmd('let g:vimtex_compiler_latexmk = { "options" : [ "-shell-escape", "-interaction=nonstopmode" , "-synctex=1" ], }') - -vim.cmd('let g:vimtex_compiler_method = "latexmk"') - - ---vim.cmd('let b:tex_use_shell_escape = 1') - ---let maplocalleader = "," - - ---let g:vimtex_compiler_latexmk = { --- \ 'options' : [ --- \ '-pdf', --- \ '-shell-escape', --- \ '-verbose', --- \ '-file-line-error', --- \ '-synctex=1', --- \ '-interaction=nonstopmode', --- \ ], --- \} diff --git a/nvim/init.lua b/nvim/init.lua index baf3054..76e8ecb 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,25 +1,27 @@ -require "settings.plugins" -require "settings.options" -require "settings.cmp" -require "settings.lsp" -require "settings.devicons" -require "settings.treesitter" -require "settings.feline" -require "settings.colorscheme" -require "settings.nvim-tree" -require "settings.pairs" -require "settings.bufferline" -require "settings.comment" -require "settings.indentline" -require "settings.impatient" -require "settings.project" -require "settings.dashboard" -require "settings.haskell" -require "settings.keymaps" -require "settings.null-ls" -require "settings.prettier" -require "settings.gitsigns" -require "settings.rainbow" -require "settings.dap" -require "settings.telescope" -require "settings.autocommands" +require("settings.plugins") +require("settings.options") +require("settings.cmp") +require("settings.lsp") +require("settings.devicons") +require("settings.treesitter") +require("settings.nvim-tree") +require("settings.pairs") +require("settings.comment") +require("settings.indentline") +require("settings.project") +require("settings.dashboard") +require("settings.haskell") +require("settings.null-ls") +require("settings.rainbow") +require("settings.dap") +require("settings.autocommands") +require("settings.keymaps") +require("settings.barbar") + +-- simple plugins that don't make sense to put in a seperate file, would clutter too much +require("gitsigns").setup() +require("feline").setup() +require("telescope").setup({}) +require("telescope").load_extension("fzy_native") +require("impatient").enable_profile() +require("nightfox") diff --git a/nvim/lua/settings/autocommands.lua b/nvim/lua/settings/autocommands.lua index ec7f220..3004eb6 100644 --- a/nvim/lua/settings/autocommands.lua +++ b/nvim/lua/settings/autocommands.lua @@ -1,2 +1,14 @@ vim.cmd('let g:vimtex_view_general_viewer = "evince"') vim.cmd('let g:vimtex_compiler_method = "latexmk"') +vim.cmd("colorscheme nightfox") + +vim.cmd([[highlight TabLineSel guifg=#192330 guibg=#192330]]) +vim.cmd([[highlight BufferCurrent guifg=#FFFFFF guibg=#192330]]) +vim.cmd([[highlight BufferCurrentIndex guifg=#FFFFFF guibg=#192330]]) +vim.cmd([[highlight BufferCurrentMod guifg=#dbc074 guibg=#192330]]) +vim.cmd([[highlight BufferCurrentSign guifg=#719cd6 guibg=#192330]]) +vim.cmd([[highlight BufferCurrentTarget guifg=#c94f6d guibg=#192330]]) +vim.cmd([[highlight BufferInactive guifg=#888888 guibg=#131a24]]) +vim.cmd([[highlight BufferInactiveMod guifg=#dbc074 guibg=#131a24]]) +vim.cmd([[highlight BufferInactiveSign guifg=#719cd6 guibg=#131a24]]) + diff --git a/nvim/lua/settings/barbar.lua b/nvim/lua/settings/barbar.lua new file mode 100644 index 0000000..41e8498 --- /dev/null +++ b/nvim/lua/settings/barbar.lua @@ -0,0 +1,44 @@ +-- Set barbar's options +require("bufferline").setup({ + animation = true, + auto_hide = false, + tabpages = true, + closable = true, + clickable = true, + exclude_ft = { "javascript" }, + exclude_name = { "package.json" }, + icons = true, + icon_custom_colors = false, + icon_separator_active = "", + icon_separator_inactive = "", + icon_close_tab = "", + icon_close_tab_modified = "●", + icon_pinned = "車", + insert_at_end = false, + maximum_padding = 1, + minimum_padding = 1, + maximum_length = 30, + semantic_letters = true, + letters = "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP", + no_name_title = nil, +}) + +local nvim_tree_events = require("nvim-tree.events") +local bufferline_api = require("bufferline.api") + +local function get_tree_size() + return require("nvim-tree.view").View.width +end + +nvim_tree_events.subscribe("TreeOpen", function() + bufferline_api.set_offset(get_tree_size()) +end) + +nvim_tree_events.subscribe("Resize", function() + bufferline_api.set_offset(get_tree_size()) +end) + +nvim_tree_events.subscribe("TreeClose", function() + bufferline_api.set_offset(0) +end) + diff --git a/nvim/lua/settings/bufferline.lua b/nvim/lua/settings/bufferline.lua deleted file mode 100644 index cdf728b..0000000 --- a/nvim/lua/settings/bufferline.lua +++ /dev/null @@ -1,146 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator = { - style = 'icon', - }, - buffer_close_icon = "", - -- buffer_close_icon = '', - modified_icon = "●", - close_icon = "", - -- close_icon = '', - left_trunc_marker = "", - right_trunc_marker = "", - -- end, - max_name_length = 30, - max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_close_icon = true, - show_tab_indicators = false, - persist_buffer_sort = true,-- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - hover = { - enabled = true, - delay = 200, - reveal = {'close'} - }, - -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) - -- -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - }, - highlights = { - fill = { - fg = { attribute = "fg", highlight = "#ff0000" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - -- buffer_selected = { - -- guifg = {attribute='fg',highlight='#ff0000'}, - -- guibg = {attribute='bg',highlight='#0000ff'}, - -- gui = 'none' - -- }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - -- close_button_selected = { - -- guifg = {attribute='fg',highlight='TabLineSel'}, - -- guibg ={attribute='bg',highlight='TabLineSel'} - -- }, - - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - italic = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - separator_visible = { - fg = {attribute='bg',highlight='TabLine'}, - bg = {attribute='bg',highlight='TabLine'} - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, -} diff --git a/nvim/lua/settings/cmp.lua b/nvim/lua/settings/cmp.lua index ef9069a..f92eab1 100644 --- a/nvim/lua/settings/cmp.lua +++ b/nvim/lua/settings/cmp.lua @@ -1,11 +1,11 @@ local cmp_status_ok, cmp = pcall(require, "cmp") if not cmp_status_ok then - return + return end local snip_status_ok, luasnip = pcall(require, "luasnip") if not snip_status_ok then - return + return end vim.cmd('let g:snipMate = {"snippet_version" : 1 }') @@ -13,121 +13,130 @@ require("luasnip/loaders/from_vscode").lazy_load() require("luasnip.loaders.from_snipmate").lazy_load() local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" + local col = vim.fn.col(".") - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") end --   פּ ﯟ   some other good icons local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", + Text = "", + Method = "m", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", } -- find more here: https://www.nerdfonts.com/cheat-sheet -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), +cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) - -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = false, - native_menu = false, - }, -} + [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [""] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }), + -- Accept currently selected item. If none selected, `select` first item. + -- Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) + -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + vim_item.menu = ({ + nvim_lsp = "[LSP]", + luasnip = "[Snippet]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + { + name = "spell", + option = { + keep_all_entries = false, + enable_in_context = function() + return true + end, + }, + }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + window = { + documentation = { + border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, + }, + }, + experimental = { + ghost_text = false, + native_menu = false, + }, +}) diff --git a/nvim/lua/settings/colorscheme.lua b/nvim/lua/settings/colorscheme.lua deleted file mode 100644 index 04f4019..0000000 --- a/nvim/lua/settings/colorscheme.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, _ = pcall(require, "nightfox") -if not status_ok then - return -end - -vim.cmd("colorscheme nightfox") diff --git a/nvim/lua/settings/comment.lua b/nvim/lua/settings/comment.lua index 2fa4a56..97fbe60 100644 --- a/nvim/lua/settings/comment.lua +++ b/nvim/lua/settings/comment.lua @@ -20,3 +20,5 @@ comment.setup { } end, } +vim.cmd([[highlight TabLineSel guifg=#192330 guibg=112e54]]) +vim.cmd([[highlight BufferDefaultCurrent guifg=#192330 guibg=112e54]]) diff --git a/nvim/lua/settings/cpp-dap.lua b/nvim/lua/settings/cpp-dap.lua deleted file mode 100644 index 5f86d08..0000000 --- a/nvim/lua/settings/cpp-dap.lua +++ /dev/null @@ -1,45 +0,0 @@ -local dap = require('dap') -dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', - command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7', -} - -dap.configurations.cpp = { - { - name = "Launch file", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = "Launch file --gui", - type = "cppdbg", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - args = {'--gui'}, - cwd = '${workspaceFolder}', - stopAtEntry = true, - }, - { - name = 'Attach to gdbserver :1234', - type = 'cppdbg', - request = 'launch', - MIMode = 'gdb', - miDebuggerServerAddress = 'localhost:1234', - miDebuggerPath = '/usr/bin/gdb', - cwd = '${workspaceFolder}', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file') - end, - }, -} - -dap.configurations.c = dap.configurations.cpp -dap.configurations.rust = dap.configurations.cpp diff --git a/nvim/lua/settings/dap-ui.lua b/nvim/lua/settings/dap-ui.lua deleted file mode 100644 index cbd3d24..0000000 --- a/nvim/lua/settings/dap-ui.lua +++ /dev/null @@ -1,73 +0,0 @@ -require("dapui").setup({ - icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - controls = { - -- Requires Neovim nightly (or 0.8 when released) - enabled = true, - -- Display controls in this element - element = "repl", - icons = { - pause = "", - play = "", - step_into = "", - step_over = "", - step_out = "", - step_back = "", - run_last = "↻", - terminate = "□", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - max_value_lines = 100, -- Can be integer or nil. - } -}) -require("dapui").setup() diff --git a/nvim/lua/settings/devicons.lua b/nvim/lua/settings/devicons.lua index 57c1386..3aea2da 100644 --- a/nvim/lua/settings/devicons.lua +++ b/nvim/lua/settings/devicons.lua @@ -3,7 +3,6 @@ if not status_ok then return end - require'nvim-web-devicons'.setup { -- your personnal icons can go here (to override) -- you can specify color or cterm_color instead of specifying both of them diff --git a/nvim/lua/settings/feline.lua b/nvim/lua/settings/feline.lua deleted file mode 100644 index afda8a9..0000000 --- a/nvim/lua/settings/feline.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, _ = pcall(require, "feline") -if not status_ok then - return -end - - -require('feline').setup() ---require('feline').winbar.setup() diff --git a/nvim/lua/settings/gitsigns.lua b/nvim/lua/settings/gitsigns.lua deleted file mode 100644 index 91fa65b..0000000 --- a/nvim/lua/settings/gitsigns.lua +++ /dev/null @@ -1 +0,0 @@ -require('gitsigns').setup() diff --git a/nvim/lua/settings/impatient.lua b/nvim/lua/settings/impatient.lua deleted file mode 100644 index 84419e0..0000000 --- a/nvim/lua/settings/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/nvim/lua/settings/indentline.lua b/nvim/lua/settings/indentline.lua index fdf5870..6b09906 100644 --- a/nvim/lua/settings/indentline.lua +++ b/nvim/lua/settings/indentline.lua @@ -58,10 +58,10 @@ vim.wo.colorcolumn = "99999" -- vim.opt.listchars:append "eol:↴" indent_blankline.setup({ - -- show_end_of_line = true, - -- space_char_blankline = " ", + show_end_of_line = true, + space_char_blankline = " ", show_current_context = true, - -- show_current_context_start = true, + show_current_context_start = true, -- char_highlight_list = { -- "IndentBlanklineIndent1", -- "IndentBlanklineIndent2", diff --git a/nvim/lua/settings/keymaps.lua b/nvim/lua/settings/keymaps.lua index f1f6ae3..e85756f 100644 --- a/nvim/lua/settings/keymaps.lua +++ b/nvim/lua/settings/keymaps.lua @@ -5,7 +5,6 @@ local term_opts = { silent = true } -- Shorten function name local keymap = vim.api.nvim_set_keymap - keymap("n", "c", ":CodeActionMenu", opts) keymap("n", "", ':lua require("dap").toggle_breakpoint()', opts) keymap("n", "", ':lua require("dap").step_over()', opts) @@ -17,7 +16,13 @@ keymap("n", "", ':lua require("dap").continue() :lua require("dapui").t keymap("n", "t", ':lua require("nvim-tree").toggle()', opts) keymap("n", "f", ':lua require("nvim-tree").focus()', opts) -keymap("n", "", ':BufferLineMoveNext', opts) -keymap("n", "", ':BufferLineMovePrev', opts) +keymap("n", "", ":BufferPrev", opts) +keymap("n", "", ":BufferNext", opts) -keymap("n", "", ':lua vim.lsp.buf.format { async = true }', opts) +keymap("n", "", ":lua vim.lsp.buf.format { async = true }", opts) + +local builtin = require("telescope.builtin") +vim.keymap.set("n", "ff", builtin.find_files, {}) +vim.keymap.set("n", "fg", builtin.live_grep, {}) +vim.keymap.set("n", "fb", builtin.buffers, {}) +vim.keymap.set("n", "fh", builtin.help_tags, {}) diff --git a/nvim/lua/settings/lint.lua b/nvim/lua/settings/lint.lua deleted file mode 100644 index ad45d4c..0000000 --- a/nvim/lua/settings/lint.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('lint').linters_by_ft = { - javascript = {'eslint',}, - react = {'eslint',}, -} diff --git a/nvim/lua/settings/lsp.lua b/nvim/lua/settings/lsp.lua index beddafb..ed876a1 100644 --- a/nvim/lua/settings/lsp.lua +++ b/nvim/lua/settings/lsp.lua @@ -4,114 +4,112 @@ if not status_ok then end require("mason").setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, }) require("mason-lspconfig").setup({ - ensure_installed = { - "cssls", -- css - "html", -- html - "eslint", -- latex - "clangd", -- cpp / c - "tsserver", -- python - "texlab", -- latex - "sumneko_lua", -- lua - "pyright", -- python - "rust_analyzer", -- rust - "jdtls", -- jdtls - "cmake", -- cmake - "bashls", -- shell - "ansiblels", -- ansible - "csharp_ls", -- dotnot - "hls" -- haskel - }, - automatic_installation = true + ensure_installed = { + "cssls", -- css + "html", -- html + "eslint", -- latex + "clangd", -- cpp / c + "tsserver", -- python + "texlab", -- latex + "sumneko_lua", -- lua + "pyright", -- python + "rust_analyzer", -- rust + "jdtls", -- jdtls + "cmake", -- cmake + "bashls", -- shell + "ansiblels", -- ansible + "csharp_ls", -- dotnot + "hls", -- haskel + }, + automatic_installation = true, }) -require('lspconfig')['cssls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) -require('lspconfig')['html'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["cssls"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['eslint'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["html"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['clangd'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["eslint"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['tsserver'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["clangd"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['texlab'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["tsserver"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['sumneko_lua'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["texlab"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['pyright'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["sumneko_lua"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['rust_analyzer'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["pyright"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['jdtls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["rust_analyzer"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['cmake'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["jdtls"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) -require('lspconfig')['bashls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['ansiblels'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['csharp_ls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} - -require('lspconfig')['hls'].setup{ - capabilities = capabilities, - on_attach = on_attach -} +require("lspconfig")["cmake"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) +require("lspconfig")["bashls"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) +require("lspconfig")["ansiblels"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) +require("lspconfig")["csharp_ls"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) +require("lspconfig")["hls"].setup({ + capabilities = capabilities, + --on_attach = on_attach, +}) --local status_ok2, lsp_installer = pcall(require, "mason") --if not status_ok2 then diff --git a/nvim/lua/settings/lua_codeactions.lua b/nvim/lua/settings/lua_codeactions.lua deleted file mode 100644 index 1d24ff5..0000000 --- a/nvim/lua/settings/lua_codeactions.lua +++ /dev/null @@ -1,14 +0,0 @@ -local M = {} - -local lsp_util = vim.lsp.util - -function M.code_action_listener() - local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } - local params = lsp_util.make_range_params() - params.context = context - vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result) - -- do something with result - e.g. check if empty and show some indication such as a sign - end) -end - -return M diff --git a/nvim/lua/settings/null-ls.lua b/nvim/lua/settings/null-ls.lua index 5f33860..efd88e9 100644 --- a/nvim/lua/settings/null-ls.lua +++ b/nvim/lua/settings/null-ls.lua @@ -11,25 +11,17 @@ require("mason-null-ls").setup({ "autopep8", "stylua", "rustfmt", - "stylish-haskell", + "stylish-haskell", }, }) null_ls.setup({ on_attach = function(client, bufnr) - if client.server_capabilities.documentFormattingProvider then - vim.cmd("nnoremap f :lua vim.lsp.buf.format { async = true }") - - -- format on save - vim.cmd("autocmd BufWritePost lua vim.lsp.buf.format { async = true }") - end - if client.server_capabilities.documentRangeFormattingProvider then vim.cmd("xnoremap f :lua vim.lsp.buf.range_formatting({})") end end, sources = { - require("null-ls").builtins.completion.spell, require("null-ls").builtins.formatting.prettier, require("null-ls").builtins.formatting.clang_format, require("null-ls").builtins.formatting.latexindent, diff --git a/nvim/lua/settings/nvim-tree.lua b/nvim/lua/settings/nvim-tree.lua index 7815e9c..e24fae6 100644 --- a/nvim/lua/settings/nvim-tree.lua +++ b/nvim/lua/settings/nvim-tree.lua @@ -11,18 +11,6 @@ if not config_status_ok then return end --- Replaces auto_close ---local tree_cb = nvim_tree_config.nvim_tree_callback ---vim.api.nvim_create_autocmd("BufEnter", { --- nested = true, --- callback = function() --- if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then --- vim.cmd "quit" --- end --- end ---}) - - nvim_tree.setup { -- BEGIN_DEFAULT_OPTS auto_reload_on_write = true, create_in_closed_folder = false, @@ -47,7 +35,6 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS adaptive_size = false, centralize_selection = false, width = 30, - height = 30, hide_root_folder = false, side = "left", preserve_window_proportions = false, @@ -58,7 +45,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS mappings = { custom_only = false, list = { - -- user mappings go here + -- user mappings go here }, }, float = { @@ -136,7 +123,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS auto_open = true, }, update_focused_file = { - enable = false, + enable = true, update_root = false, ignore_list = {}, }, @@ -231,4 +218,24 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS }, } -vim.g.nvim_tree_group_empty = 1 +-- nvim-tree is also there in modified buffers so this function filter it out +local modifiedBufs = function(bufs) + local t = 0 + for k,v in pairs(bufs) do + if v.name:match("NvimTree_") == nil then + t = t + 1 + end + end + return t +end + +vim.api.nvim_create_autocmd("BufEnter", { + nested = true, + callback = function() + if #vim.api.nvim_list_wins() == 1 and + vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil and + modifiedBufs(vim.fn.getbufinfo({bufmodified = 1})) == 0 then + vim.cmd "quit" + end + end +}) diff --git a/nvim/lua/settings/options.lua b/nvim/lua/settings/options.lua index 047d1c5..d7c4ca1 100644 --- a/nvim/lua/settings/options.lua +++ b/nvim/lua/settings/options.lua @@ -7,21 +7,21 @@ local options = { smartcase = true, showmode = true, termguicolors = true, --- winbar = "", + -- winbar = "", ignorecase = true, showtabline = 2, - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default) - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, - scrolloff = 8, -- is one of my fav - sidescrolloff = 8, - spell = true, - spelllang = "en_us", - mousemodel = "popup_setpos", + timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) + undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default) + writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited + expandtab = true, -- convert tabs to spaces + shiftwidth = 2, -- the number of spaces inserted for each indentation + tabstop = 2, -- insert 2 spaces for a tab + cursorline = true, + scrolloff = 8, -- is one of my fav + sidescrolloff = 8, + spell = true, + spelllang = "en_us", + mousemodel = "popup_setpos", } --vim.opt.shortmess:append "c" @@ -29,5 +29,3 @@ local options = { for k, v in pairs(options) do vim.opt[k] = v end - - diff --git a/nvim/lua/settings/pairs.lua b/nvim/lua/settings/pairs.lua index 577e571..ddbd181 100644 --- a/nvim/lua/settings/pairs.lua +++ b/nvim/lua/settings/pairs.lua @@ -1,33 +1,36 @@ -- Setup nvim-cmp. local status_ok, npairs = pcall(require, "nvim-autopairs") if not status_ok then - return + return end +local Rule = require('nvim-autopairs.rule') -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} +npairs.setup({ + check_ts = true, + ts_config = { + lua = { "string", "source" }, + javascript = { "string", "template_string" }, + java = false, + }, + disable_filetype = { "TelescopePrompt", "spectre_panel" }, + fast_wrap = { + map = "", + chars = { "{", "[", "(", "<", '"', "'"}, + pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), + offset = 0, -- Offset from pattern match + end_key = "$", + keys = "qwertyuiopzxcvbnmasdfghjkl", + check_comma = true, + highlight = "PmenuSel", + highlight_grey = "LineNr", + }, +}) -local cmp_autopairs = require "nvim-autopairs.completion.cmp" +npairs.add_rule(Rule("<",">")) + +local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_status_ok, cmp = pcall(require, "cmp") if not cmp_status_ok then - return + return end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) diff --git a/nvim/lua/settings/plugins.lua b/nvim/lua/settings/plugins.lua index 0c1a96f..55f91f0 100644 --- a/nvim/lua/settings/plugins.lua +++ b/nvim/lua/settings/plugins.lua @@ -1,54 +1,54 @@ -local Plug = vim.fn['plug#'] -vim.call('plug#begin', '~/.config/nvim/plugged') -Plug 'folke/twilight.nvim' -Plug 'nvim-lua/popup.nvim' -- An implementation of the Popup API from vim in Neovim -Plug 'nvim-lua/plenary.nvim' -- Useful lua functions used ny lots of plugins -Plug 'EdenEast/nightfox.nvim' -Plug 'kyazdani42/nvim-web-devicons' -Plug 'feline-nvim/feline.nvim' -Plug 'lewis6991/gitsigns.nvim' -Plug 'tanvirtin/vgit.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'b3nj5m1n/kommentary' -Plug 'antoinemadec/FixCursorHold.nvim' -Plug 'lambdalisue/fern.vim' -Plug "williamboman/mason.nvim" -Plug "williamboman/mason-lspconfig.nvim" -Plug 'neovim/nvim-lspconfig' -Plug 'jose-elias-alvarez/null-ls.nvim' -Plug 'jayp0521/mason-null-ls.nvim' -Plug 'mfussenegger/nvim-dap' -Plug 'rcarriga/nvim-dap-ui' -Plug 'theHamsta/nvim-dap-virtual-text' -Plug 'jayp0521/mason-nvim-dap.nvim' -Plug('nvim-treesitter/nvim-treesitter', { ['do'] = vim.fn[':TSUpdate'] }) -Plug 'hrsh7th/nvim-cmp' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'saadparwaiz1/cmp_luasnip' -Plug 'L3MON4D3/LuaSnip' -Plug 'MarcWeber/vim-addon-mw-utils' -Plug 'tomtom/tlib_vim' -Plug 'garbas/vim-snipmate' -Plug 'kyazdani42/nvim-tree.lua' -Plug 'windwp/nvim-autopairs' -Plug 'akinsho/bufferline.nvim' -Plug 'numToStr/Comment.nvim' -Plug 'lukas-reineke/indent-blankline.nvim' -Plug 'lewis6991/impatient.nvim' -Plug 'lewis6991/spellsitter.nvim' -Plug 'moll/vim-bbye' -Plug 'nvim-telescope/telescope.nvim' -Plug 'ahmedkhalf/project.nvim' -Plug 'goolord/alpha-nvim' -Plug 'lervag/vimtex' -Plug 'weilbith/nvim-code-action-menu' -Plug 'MunifTanjim/prettier.nvim' -Plug 'rafamadriz/friendly-snippets' -Plug 'p00f/nvim-ts-rainbow' -Plug 'nvim-telescope/telescope-ui-select.nvim' -Plug 'nvim-telescope/telescope-file-browser.nvim' -Plug 'nvim-telescope/telescope-fzy-native.nvim' -vim.call('plug#end') +local Plug = vim.fn["plug#"] +vim.call("plug#begin", "~/.config/nvim/plugged") +Plug("folke/twilight.nvim") +Plug("nvim-lua/popup.nvim") -- An implementation of the Popup API from vim in Neovim +Plug("nvim-lua/plenary.nvim") -- Useful lua functions used ny lots of plugins +Plug("EdenEast/nightfox.nvim") +Plug("kyazdani42/nvim-web-devicons") +Plug("feline-nvim/feline.nvim") +Plug("lewis6991/gitsigns.nvim") +Plug("tanvirtin/vgit.nvim") +Plug("nvim-lua/plenary.nvim") +Plug("b3nj5m1n/kommentary") +Plug("antoinemadec/FixCursorHold.nvim") +Plug("lambdalisue/fern.vim") +Plug("williamboman/mason.nvim") +Plug("williamboman/mason-lspconfig.nvim") +Plug("neovim/nvim-lspconfig") +Plug("jose-elias-alvarez/null-ls.nvim") +Plug("jayp0521/mason-null-ls.nvim") +Plug("mfussenegger/nvim-dap") +Plug("rcarriga/nvim-dap-ui") +Plug("theHamsta/nvim-dap-virtual-text") +Plug("jayp0521/mason-nvim-dap.nvim") +Plug("nvim-treesitter/nvim-treesitter", { ["do"] = vim.fn[":TSUpdate"] }) +Plug("hrsh7th/nvim-cmp") +Plug("hrsh7th/cmp-nvim-lsp") +Plug("hrsh7th/cmp-buffer") +Plug("hrsh7th/cmp-path") +Plug("hrsh7th/cmp-cmdline") +Plug("f3fora/cmp-spell") +Plug("saadparwaiz1/cmp_luasnip") +Plug("L3MON4D3/LuaSnip") +Plug("MarcWeber/vim-addon-mw-utils") +Plug("tomtom/tlib_vim") +Plug("garbas/vim-snipmate") +Plug("kyazdani42/nvim-tree.lua") +Plug("windwp/nvim-autopairs") +Plug("romgrk/barbar.nvim") +Plug("numToStr/Comment.nvim") +Plug("lukas-reineke/indent-blankline.nvim") +Plug("lewis6991/impatient.nvim") +Plug("lewis6991/spellsitter.nvim") +Plug("moll/vim-bbye") +Plug("nvim-telescope/telescope.nvim") +Plug("ahmedkhalf/project.nvim") +Plug("goolord/alpha-nvim") +Plug("lervag/vimtex") +Plug("weilbith/nvim-code-action-menu") +Plug("rafamadriz/friendly-snippets") +Plug("p00f/nvim-ts-rainbow") +Plug("nvim-telescope/telescope-ui-select.nvim") +Plug("nvim-telescope/telescope-file-browser.nvim") +Plug("nvim-telescope/telescope-fzy-native.nvim") +vim.call("plug#end") diff --git a/nvim/lua/settings/prettier.lua b/nvim/lua/settings/prettier.lua deleted file mode 100644 index 91e8bb5..0000000 --- a/nvim/lua/settings/prettier.lua +++ /dev/null @@ -1,19 +0,0 @@ -local prettier = require("prettier") - -prettier.setup({ - bin = 'prettier', -- or `prettierd` - filetypes = { - "css", - "graphql", - "html", - "javascript", - "javascriptreact", - "json", - "less", - "markdown", - "scss", - "typescript", - "typescriptreact", - "yaml", - }, -}) diff --git a/nvim/lua/settings/project.lua b/nvim/lua/settings/project.lua index 27a1329..5f561e6 100644 --- a/nvim/lua/settings/project.lua +++ b/nvim/lua/settings/project.lua @@ -3,41 +3,15 @@ if not status_ok then return end project.setup({ - ---@usage set to false to disable project.nvim. - --- This is on by default since it's currently the expected behavior. active = true, - on_config_done = nil, - - ---@usage set to true to disable setting the current-woriking directory - --- Manual mode doesn't automatically change your root directory, so you have - --- the option to manually do so using `:ProjectRoot` command. manual_mode = false, - - ---@usage Methods of detecting the root directory - --- Allowed values: **"lsp"** uses the native neovim lsp - --- **"pattern"** uses vim-rooter like glob pattern matching. Here - --- order matters: if one is not detected, the other is used as fallback. You - --- can also delete or rearangne the detection methods. - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project detection_methods = { "pattern" }, - - ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - - ---@ Show hidden files in telescope when searching for files in a project show_hidden = false, - - ---@usage When set to false, you will get a message when project.nvim changes your directory. - -- When set to false, you will get a message when project.nvim changes your directory. silent_chdir = true, - - ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } ignore_lsp = {}, - - ---@type string - ---@usage path to store the project history for use in telescope - datapath = vim.fn.stdpath("data"), + datapath = vim.fn.stdpath("data"), }) local tele_status_ok, telescope = pcall(require, "telescope") @@ -45,4 +19,4 @@ if not tele_status_ok then return end -telescope.load_extension('projects') +telescope.load_extension("projects") diff --git a/nvim/lua/settings/rainbow.lua b/nvim/lua/settings/rainbow.lua index a070e04..f875b69 100644 --- a/nvim/lua/settings/rainbow.lua +++ b/nvim/lua/settings/rainbow.lua @@ -1,14 +1,9 @@ require("nvim-treesitter.configs").setup { highlight = { - -- ... }, - -- ... rainbow = { enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings + extended_mode = true, + max_file_lines = nil, } } diff --git a/nvim/lua/settings/telescope.lua b/nvim/lua/settings/telescope.lua deleted file mode 100644 index 790836a..0000000 --- a/nvim/lua/settings/telescope.lua +++ /dev/null @@ -1,8 +0,0 @@ -local builtin = require('telescope.builtin') -local async = require "plenary.async" -require('telescope').setup{} -require('telescope').load_extension('fzy_native') -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/nvim/lua/settings/treesitter.lua b/nvim/lua/settings/treesitter.lua index 7068904..0c37e2e 100644 --- a/nvim/lua/settings/treesitter.lua +++ b/nvim/lua/settings/treesitter.lua @@ -3,19 +3,18 @@ if not status_ok then return end -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "latex" , "c", "cpp" , "rust" , "lua", "haskell" , "java" , "javascript" , "typescript" }, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, -} +require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { "latex", "c", "cpp", "rust", "lua", "haskell", "java", "javascript", "typescript" }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, +}) local status_ok2, _ = pcall(require, "spellsitter") if not status_ok2 then - return + return end require("spellsitter").setup() - diff --git a/nvim/lua/settings/vimtex.lua b/nvim/lua/settings/vimtex.lua deleted file mode 100644 index 9677bf0..0000000 --- a/nvim/lua/settings/vimtex.lua +++ /dev/null @@ -1,24 +0,0 @@ ---vim.cmd('let g:vimtex_view_method = "zathura"') -vim.cmd('let g:vimtex_view_general_viewer = "evince"') ---let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' - ---vim.cmd('let g:vimtex_compiler_latexmk = { "options" : [ "-shell-escape", "-interaction=nonstopmode" , "-synctex=1" ], }') - -vim.cmd('let g:vimtex_compiler_method = "latexmk"') - - ---vim.cmd('let b:tex_use_shell_escape = 1') - ---let maplocalleader = "," - - ---let g:vimtex_compiler_latexmk = { --- \ 'options' : [ --- \ '-pdf', --- \ '-shell-escape', --- \ '-verbose', --- \ '-file-line-error', --- \ '-synctex=1', --- \ '-interaction=nonstopmode', --- \ ], --- \} diff --git a/nvim/snippets/tex.snippets b/nvim/snippets/tex.snippets index 4afec87..7ea597f 100644 --- a/nvim/snippets/tex.snippets +++ b/nvim/snippets/tex.snippets @@ -13,11 +13,21 @@ snippet code "code" snippet list "list" \\begin{itemize} \\item $1 + \\item $2 + \\item $3 + \\item $4 + \\item $5 + \\vspace{-3mm} \\end{itemize} snippet enum "enumerate" \\begin{enumerate} - \\item + \\item $1 + \\item $2 + \\item $3 + \\item $4 + \\item $5 + \\vspace{-3mm} \\end{enumerate} snippet table "table" @@ -32,5 +42,13 @@ snippet table "table" snippet tabular "tabular" \\begin{tabular}{|m{0.2\linewidth}|m{0.755\linewidth}|} + \hline $1 + \hline \\end{tabular} + +snippet tx "textcolor" + \\textcolor{${1}}{${2}} + +snippet bm "vectormatrix" + \\begin{bmatrix} $1 \\ $2 \\ $3 \end{bmatrix}