You've already forked dotfiles
feat: Removing nvim-lspconfig and starting the removal of Mason, adding
in LSP definitions for servers that are used, adding in a script to check for LSPs, removing some extraneous items in the tmux conf, moving autopairs to its own file
This commit is contained in:
3
nvim/lua/plugins/autopairs.lua
Normal file
3
nvim/lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
vim.pack.add({'https://github.com/nvim-autopairs'})
|
||||
|
||||
require('nvim-autopairs').setup()
|
||||
@@ -31,19 +31,19 @@ require('gitsigns').setup {
|
||||
end)
|
||||
|
||||
-- Actions
|
||||
map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gu', gitsigns.undo_stage_hunk)
|
||||
map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gS', gitsigns.stage_buffer)
|
||||
map('n', '<leader>gR', gitsigns.reset_buffer)
|
||||
map('n', '<leader>gp', gitsigns.preview_hunk)
|
||||
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
|
||||
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
|
||||
map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings
|
||||
-- map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gtd', gitsigns.toggle_deleted)
|
||||
|
||||
-- Text object
|
||||
|
||||
@@ -17,18 +17,18 @@ vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = {
|
||||
prefix = "●",
|
||||
source = 'always',
|
||||
source = true,
|
||||
},
|
||||
severity_sort = true,
|
||||
float = {
|
||||
source = 'always'
|
||||
source = true
|
||||
}
|
||||
})
|
||||
|
||||
-- Install and enable the language server settings from nvim-lspconfig
|
||||
vim.pack.add({
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
})
|
||||
-- vim.pack.add({
|
||||
-- 'https://github.com/neovim/nvim-lspconfig',
|
||||
-- })
|
||||
|
||||
-- Auto set keymaps and other settings on LSP attach
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
@@ -37,29 +37,33 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
local bufnr = args.buf
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
|
||||
vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
|
||||
vim.keymap.set('n', '<C-[>', function() vim.diagnostic.jump({ count = -1, float = true }) end, bufopts)
|
||||
vim.keymap.set('n', '<C-]>', function() vim.diagnostic.jump({ count = 1, float = true }) end, bufopts)
|
||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>for', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Enable LSP engines
|
||||
local enabled_lsps = {
|
||||
'clangd',
|
||||
'bashls',
|
||||
'gdscript',
|
||||
'jinja_lsp',
|
||||
'lua_ls',
|
||||
'pylsp',
|
||||
'r_language_server',
|
||||
'rust_analyzer',
|
||||
'yamlls',
|
||||
}
|
||||
|
||||
for _, lsp in pairs(enabled_lsps) do
|
||||
|
||||
@@ -20,8 +20,15 @@ require('lualine').setup {
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_c = {
|
||||
'filename',
|
||||
'lsp_status',
|
||||
},
|
||||
lualine_x = {
|
||||
'encoding', 'fileformat', 'filetype', get_schema
|
||||
'encoding',
|
||||
'fileformat',
|
||||
'filetype',
|
||||
get_schema,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/mason-org/mason.nvim',
|
||||
'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||
})
|
||||
-- vim.pack.add({
|
||||
-- 'https://github.com/mason-org/mason.nvim',
|
||||
-- 'https://github.com/mason-org/mason-lspconfig.nvim',
|
||||
-- })
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup {
|
||||
automatic_enable = true,
|
||||
ensure_installed = {
|
||||
'ansiblels', -- Ansible
|
||||
'arduino_language_server', -- Arduino specific C
|
||||
'bashls', -- Bash
|
||||
'clangd', -- C/C++
|
||||
'intelephense', -- PHP
|
||||
'lua_ls', -- Lua
|
||||
'marksman', -- markdown
|
||||
'pylsp', -- Python
|
||||
'rust_analyzer', -- Rust
|
||||
'yamlls', -- YAML
|
||||
}
|
||||
}
|
||||
-- require('mason').setup()
|
||||
-- require('mason-lspconfig').setup {
|
||||
-- automatic_enable = true,
|
||||
-- ensure_installed = {
|
||||
-- 'ansiblels', -- Ansible
|
||||
-- 'arduino_language_server', -- Arduino specific C
|
||||
-- 'bashls', -- Bash
|
||||
-- 'clangd', -- C/C++
|
||||
-- 'intelephense', -- PHP
|
||||
-- 'jinja_lsp', -- Jinja2
|
||||
-- 'lua_ls', -- Lua
|
||||
-- 'marksman', -- markdown
|
||||
-- 'pylsp', -- Python
|
||||
-- 'rust_analyzer', -- Rust
|
||||
-- 'shellcheck', -- Bash
|
||||
-- 'yamlls', -- YAML
|
||||
-- }
|
||||
-- }
|
||||
|
||||
@@ -21,7 +21,7 @@ cmp.setup {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-space>'] = cmp.mapping.complete(), -- TODO: Overlaps with completion(? possibly doesn't due to state)
|
||||
['<C-space>'] = cmp.mapping.complete(),
|
||||
['<C-y>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
|
||||
@@ -20,7 +20,6 @@ require('telescope').setup {
|
||||
'node_modules',
|
||||
},
|
||||
layout_config = { prompt_position = 'bottom' },
|
||||
-- layout_strategy = 'vertical',
|
||||
mappings = {
|
||||
i = { ['<ESC>'] = require('telescope.actions').close, },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user