mirror of
https://github.com/cole-maxwell1/dotfiles.git
synced 2026-01-25 22:41:48 -05:00
Add starter nvim config
This commit is contained in:
34
.config/nvim/after/plugin/lsp.lua
Normal file
34
.config/nvim/after/plugin/lsp.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local lsp_zero = require('lsp-zero')
|
||||
|
||||
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
end)
|
||||
|
||||
lsp_zero.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = '»'
|
||||
})
|
||||
|
||||
-- to learn how to use mason.nvim
|
||||
-- read this: https://github.com/VonHeikemen/lsp-zero.nvim/blob/v3.x/doc/md/guide/integrate-with-mason-nvim.md
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'tsserver',
|
||||
'eslint',
|
||||
'gopls',
|
||||
'rust_analyzer',
|
||||
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({})
|
||||
end,
|
||||
},
|
||||
})
|
||||
11
.config/nvim/after/plugin/nvim-cmp.lua
Normal file
11
.config/nvim/after/plugin/nvim-cmp.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
}),
|
||||
preselect = 'item',
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
})
|
||||
3
.config/nvim/after/plugin/telescope.lua
Normal file
3
.config/nvim/after/plugin/telescope.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
|
||||
Reference in New Issue
Block a user