diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 925bdd8..0ed4050 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -149,7 +149,6 @@ call plug#begin('~/.config/nvim/plugged') Plug 'hrsh7th/cmp-vsnip' Plug 'hrsh7th/nvim-vsnip' - " Telescope Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' @@ -181,7 +180,7 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { 'pyright', 'bashls', 'yamlls', 'ansiblels' } +local servers = { 'pyright', 'bashls', 'ansiblels' } for _, lsp in pairs(servers) do require('lspconfig')[lsp].setup { on_attach = on_attach, @@ -192,6 +191,17 @@ for _, lsp in pairs(servers) do } end +require'lspconfig'.yamlls.setup{ + settings = { + json = { + schemas = { + ansible = 'https://github.com/ansible/schemas/blob/main/f/ansible.json', + kubernetes = 'https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.1-standalone/all.json' + } + }, + } +} + -- luasnip setup local luasnip = require 'luasnip' @@ -201,7 +211,6 @@ cmp.setup { snippet = { expand = function(args) luasnip.lsp_expand(args.body) - end, }, mapping = cmp.mapping.preset.insert({ @@ -294,7 +303,7 @@ let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-go', 'CodeLLDB', 'vscode " Theme """""""""""""""""""""""""""""""" "colorscheme gruvbox -" colorscheme default +"colorscheme default colorscheme dracula let g:gruvbox_invert_selection='0' let g:gruvbox_contrast_dark = 'hard' @@ -368,6 +377,7 @@ vnoremap < nmap e Telescope buffers nmap w Telescope find_files nmap q Telescope live_grep +nmap g Telescope git_branches " Resize window nnoremap :vertical resize +5 @@ -452,8 +462,8 @@ map :setlocal spell! spelllang=pl """""""""""""""""""""""""""""""" " Ansible -au BufRead,BufNewFile *.yml set filetype=yaml.ansible -autocmd BufWritePre *.yml :Prettier +au BufRead,BufNewFile *.yaml,*.yml if search('hosts:\|tasks:', 'nw') | set ft=yaml.ansible | endif +autocmd BufWritePre *.yaml,*.yml :Prettier " Bash autocmd FileType sh diff --git a/.config/nvim/installer.sh b/.config/nvim/installer.sh index b933576..07935f1 100755 --- a/.config/nvim/installer.sh +++ b/.config/nvim/installer.sh @@ -1,6 +1,8 @@ #!/bin/bash -npm -g i pyright bash-language-server +npm -g i pyright bash-language-server --force +npm -g i yaml-language-server --force +npm -g i @ansible/ansible-language-server --force GO111MODULE=on go install mvdan.cc/sh/v3/cmd/shfmt@latest pip install black pip3 install black