From cfe7491b561a3a81cf5c4424131c67958c038a5a Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Fri, 19 Aug 2022 21:43:08 +0930 Subject: [PATCH] continueing to setup nvim properly, struggling with LSP and christian chiarullis LSP setup, thinking it might be better to build from scratch? --- .config/nvim/init.lua | 20 ++-- .config/nvim/lua/user/bufferline.lua | 93 ------------------- .config/nvim/lua/user/cmp.lua | 6 -- .config/nvim/lua/user/comment.lua | 39 +------- .config/nvim/lua/user/copilot.lua | 35 +++++++ .config/nvim/lua/user/keymaps.lua | 80 +++++++--------- .config/nvim/lua/user/lsp/mason.lua | 8 +- .config/nvim/lua/user/lsp/settings/clangd.lua | 3 + .config/nvim/lua/user/notify.lua | 2 +- .config/nvim/lua/user/plugins.lua | 23 ++++- .config/nvim/lua/user/telescope.lua | 65 +------------ .config/nvim/lua/user/whichkey.lua | 1 - .xmonad/xmonad.hs | 2 +- 13 files changed, 116 insertions(+), 261 deletions(-) create mode 100644 .config/nvim/lua/user/copilot.lua create mode 100644 .config/nvim/lua/user/lsp/settings/clangd.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 6415789..222ee00 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,42 +1,44 @@ +require("user.options") require("user.keymaps") require("user.plugins") require("user.colorscheme") +require("user.lsp") +require("user.lsp-inlayhints") require("user.autocommands") require("user.cmp") require("user.navic") -require("user.lsp-inlayhints") -require("user.lsp") require("user.telescope") require("user.treesitter") require("user.autopairs") require("user.comment") require("user.gitsigns") require("user.nvim-tree") +require("user.bufferline") require("user.toggleterm") require("user.project") require("user.impatient") require("user.indentline") require("user.alpha") require("user.whichkey") -require("user.hop") +-- require "user.hop" require("user.matchup") -require("user.numb") +-- require "user.numb" require("user.colorizer") -require("user.spectre") +-- require "user.spectre" require("user.zen-mode") require("user.neoscroll") require("user.todo-comments") require("user.symbol-outline") require("user.notify") require("user.ts-context") +require("user.copilot") require("user.functions") require("user.illuminate") require("user.dap") -require("user.lir") -require "user.winbar" -require("user.options") +-- require "user.lir" +require("user.winbar") require("user.nvim-webdev-icons") -require("user.fidget") +-- require "user.fidget" require("user.browse") require("user.surround") require("user.harpoon") diff --git a/.config/nvim/lua/user/bufferline.lua b/.config/nvim/lua/user/bufferline.lua index dc7572e..c1963f9 100644 --- a/.config/nvim/lua/user/bufferline.lua +++ b/.config/nvim/lua/user/bufferline.lua @@ -72,97 +72,4 @@ bufferline.setup { -- return buffer_a.modified > buffer_b.modified -- end }, - highlights = { - fill = { - guifg = { attribute = "fg", highlight = "#ff0000" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - -- buffer_selected = { - -- guifg = {attribute='fg',highlight='#ff0000'}, - -- guibg = {attribute='bg',highlight='#0000ff'}, - -- gui = 'none' - -- }, - buffer_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - close_button = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - -- close_button_selected = { - -- guifg = {attribute='fg',highlight='TabLineSel'}, - -- guibg ={attribute='bg',highlight='TabLineSel'} - -- }, - - tab_selected = { - guifg = { attribute = "fg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - - duplicate_selected = { - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "TabLineSel" }, - gui = "italic", - }, - duplicate_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - gui = "italic", - }, - duplicate = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - gui = "italic", - }, - - modified = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - guifg = { attribute = "fg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - guifg = { attribute = "fg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - guifg = { attribute = "bg", highlight = "TabLine" }, - guibg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - guifg = { attribute = "bg", highlight = "Normal" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - -- separator_visible = { - -- guifg = {attribute='bg',highlight='TabLine'}, - -- guibg = {attribute='bg',highlight='TabLine'} - -- }, - indicator_selected = { - guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - guibg = { attribute = "bg", highlight = "Normal" }, - }, - }, } diff --git a/.config/nvim/lua/user/cmp.lua b/.config/nvim/lua/user/cmp.lua index 04ab76e..0b6c9bf 100644 --- a/.config/nvim/lua/user/cmp.lua +++ b/.config/nvim/lua/user/cmp.lua @@ -8,11 +8,6 @@ if not snip_status_ok then return end -local tabnine_status_ok, _ = pcall(require, "user.tabnine") -if not tabnine_status_ok then - return -end - local buffer_fts = { "markdown", "toml", @@ -211,7 +206,6 @@ cmp.setup { end end, }, - { name = "cmp_tabnine", group_index = 2 }, { name = "path", group_index = 2 }, { name = "emoji", group_index = 2 }, { name = "lab.quick_data", keyword_length = 4, group_index = 2 }, diff --git a/.config/nvim/lua/user/comment.lua b/.config/nvim/lua/user/comment.lua index 0f6ad00..fa16f91 100644 --- a/.config/nvim/lua/user/comment.lua +++ b/.config/nvim/lua/user/comment.lua @@ -3,41 +3,4 @@ if not status_ok then return end -local status_ok_1, _ = pcall(require, "lsp-inlayhints") -if not status_ok_1 then - return -end - -comment.setup { - pre_hook = function(ctx) - -- For inlay hints - local line_start = (ctx.srow or ctx.range.srow) - 1 - local line_end = ctx.erow or ctx.range.erow - require("lsp-inlayhints.core").clear(0, line_start, line_end) - - if - vim.bo.filetype == "typescriptreact" - or vim.bo.filetype == "javascriptreact" - or vim.bo.filetype == "javascript" - or vim.bo.filetype == "typescript" - then - local U = require "Comment.utils" - - -- Determine whether to use linewise or blockwise commentstring - local type = ctx.ctype == U.ctype.linewise and "__default" or "__multiline" - - -- Determine the location where to calculate commentstring from - local location = nil - if ctx.ctype == U.ctype.blockwise 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 = type, - location = location, - } - end - end, -} +comment.setup {} diff --git a/.config/nvim/lua/user/copilot.lua b/.config/nvim/lua/user/copilot.lua new file mode 100644 index 0000000..a5c9898 --- /dev/null +++ b/.config/nvim/lua/user/copilot.lua @@ -0,0 +1,35 @@ +-- For copilot.vim +-- vim.g.copilot_filetypes = { +-- ["*"] = false, +-- } + +-- vim.cmd [[ +-- imap