Update pyright settings & add tree-sitter/telescope settings
This commit is contained in:
parent
d325fee87f
commit
544b5a44a2
5 changed files with 29 additions and 4 deletions
|
|
@ -5,3 +5,4 @@ require('lsp')
|
|||
require('nvim-cmp')
|
||||
require('keybindings')
|
||||
require('auto-commands')
|
||||
require('tree-sitter')
|
||||
|
|
|
|||
|
|
@ -32,3 +32,5 @@ vim.api.nvim_create_autocmd('BufWinLeave', {
|
|||
pattern = "*",
|
||||
command = [[:call clearmatches()]],
|
||||
})
|
||||
|
||||
-- TODO: disable folding for Telescope lines, see https://github.com/nvim-telescope/telescope.nvim/issues/991#issuecomment-882059894
|
||||
|
|
|
|||
|
|
@ -20,13 +20,29 @@ local on_attach = function(client, bufnr)
|
|||
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
|
||||
buf_set_keymap('n', 'ff', '<cmd>lua require("telescope.builtin").find_files()<CR>', opts)
|
||||
buf_set_keymap('n', 'fg', '<cmd>lua require("telescope.builtin").live_grep()<CR>', opts)
|
||||
buf_set_keymap('n', 'fb', '<cmd>lua require("telescope.builtin").buffers()<CR>', opts)
|
||||
buf_set_keymap('n', 'fh', '<cmd>lua require("telescope.builtin").help_tags()<CR>', opts)
|
||||
end
|
||||
|
||||
local nvim_lsp = require('lspconfig')
|
||||
|
||||
--enable some language servers with the additional completion capabilities
|
||||
--offered by nvim-cmp
|
||||
local servers = { 'pyright', 'ansiblels', 'yamlls', 'tsserver' }
|
||||
local servers = { 'ansiblels', 'yamlls', 'tsserver' }
|
||||
|
||||
local util = require("lspconfig/util")
|
||||
|
||||
nvim_lsp.pyright.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = function(fname)
|
||||
return util.root_pattern(".git", "setup.cfg", "requirements")(fname) or
|
||||
util.path.dirname(fname)
|
||||
end
|
||||
})
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ vim.opt.path = vim.opt.path + { '**' }
|
|||
--line numbers
|
||||
vim.o.number = true
|
||||
|
||||
--changes to current directory when creating new files
|
||||
vim.o.autochdir = true
|
||||
|
||||
--higlhight search
|
||||
vim.o.hls = true
|
||||
|
||||
|
|
|
|||
9
nvim/lua/tree-sitter.lua
Normal file
9
nvim/lua/tree-sitter.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local tree_sitter_config = require('nvim-treesitter.configs')
|
||||
|
||||
tree_sitter_config.setup {
|
||||
ensure_installed = {
|
||||
'lua', 'yaml', 'bash', 'python', 'javascript', 'css', 'scss', 'html',
|
||||
'json', 'dockerfile', 'markdown',
|
||||
},
|
||||
auto_install = true,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue