diff --git a/init.vim b/init.vim index 9307ab2..02fc620 100644 --- a/init.vim +++ b/init.vim @@ -4,7 +4,7 @@ set cursorline " zvýraznění řádku s kurzorem set noshowmode set title " zobrazí název a cestu souboru set clipboard=unnamedplus " povolí kopírování a vkládání mimo Neovim -set signcolumn=number +set signcolumn=yes " zajistí number a gitgutter vedle sebe call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') @@ -19,6 +19,10 @@ imap coc#pum#visible() ? coc#pum#confirm() : "\" Plug 'othree/html5.vim' +Plug 'airblade/vim-gitgutter' " Git nápověda ke změně v kódu + +Plug 'frazrepo/vim-rainbow' " Barevné závorky + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'shellRaining/hlchunk.nvim' " Propojovací lajny v kódu (lua) @@ -39,6 +43,8 @@ Plug 'wakatime/vim-wakatime' " Wakatime Plug 'tpope/vim-fugitive' " Git - vim fugitive +Plug 'lewis6991/gitsigns.nvim' " Git Signs (lua) + Plug 'lilydjwg/colorizer' " Náhled barev css Plug 'Pocco81/auto-save.nvim' " Autosave @@ -80,29 +86,36 @@ Plug 'jacoborus/tender.vim' Plug 'nordtheme/vim' -" CMP setup - - "LSP -Plug 'neovim/nvim-lspconfig' - - "Autocompletion -Plug 'hrsh7th/nvim-cmp' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'hrsh7th/cmp-vsnip' -Plug 'hrsh7th/vim-vsnip' - - "LSP Signature -Plug 'ray-x/lsp_signature.nvim' - - "Lightbulb -Plug 'kosayoda/nvim-lightbulb' - call plug#end() - " Autostart NERDTree +lua require('kankys') " Nastavení lua pluginů ve vlastních souborech + +" Automatické instalování pluginů +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +" vim-gitgutter +let g:gitgutter_sign_added = '+' +let g:gitgutter_sign_modified = '~' +let g:gitgutter_sign_removed = '-' + +" Barevné závorky +let g:rainbow_active = 1 + +let g:rainbow_load_separately = [ + \ [ '*' , [['(', ')'], ['\[', '\]'], ['{', '}']] ], + \ [ '*.tex' , [['(', ')'], ['\[', '\]']] ], + \ [ '*.cpp' , [['(', ')'], ['\[', '\]'], ['{', '}']] ], + \ [ '*.{html,htm}' , [['(', ')'], ['\[', '\]'], ['{', '}'], ['<\a[^>]*>', ']*>']] ], + \ ] + +let g:rainbow_guifgs = ['RoyalBlue3', 'DarkOrange3', 'DarkOrchid3', 'FireBrick'] +let g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta'] + +" Autostart NERDTree " autocmd VimEnter * call NERDTreeFocus() " Autostart NERDTreeFocus " Komentáře NERD Commenter klávesové zkratky Ctrl + k + l @@ -122,114 +135,3 @@ let g:auto_save_events = ['InsertLeave', 'TextChanged'] " keys pretier vmap f (coc-format-selected) nmap f (coc-format-selected) - - - -lua <'] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'vsnip' }, - { name = 'buffer' }, - { name = 'path' }, - }, -} - --- Use buffer source for `/` -cmp.setup.cmdline('/', { - sources = { - { name = 'buffer' } - } -}) - --- Use cmdline & path source for ':' -cmp.setup.cmdline(':', { - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) -}) -EOF - -lua << EOF --- lsp_signature setup -require'lsp_signature'.setup({ - bind = true, -- This is mandatory, otherwise border config won't get registered. - handler_opts = { - border = "rounded" - } -}) -EOF - -lua << EOF --- nvim-lightbulb setup -require('nvim-lightbulb').setup({ - autocmd = { enabled = true }, -}) -EOF - -lua << EOF -require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - }, - indent = { - enable = true, - }, -} -EOF - -lua << EOF -require('hlchunk').setup({ - chunk = { - enable = true - -- ... - }, - indent = { - enable = true - -- ... - } -}) -EOF diff --git a/lua/kankys/autoclosetag.lua b/lua/kankys/autoclosetag.lua new file mode 100644 index 0000000..5c99d79 --- /dev/null +++ b/lua/kankys/autoclosetag.lua @@ -0,0 +1 @@ +require("autoclose").setup() diff --git a/lua/kankys/gitsigns.lua b/lua/kankys/gitsigns.lua new file mode 100644 index 0000000..bca97f4 --- /dev/null +++ b/lua/kankys/gitsigns.lua @@ -0,0 +1,8 @@ +require('gitsigns').setup { + -- signs config + current_line_blame = true, + current_line_blame_opts = { + virt_text_pos = 'right_align' + } +} + diff --git a/lua/kankys/hlchunk.lua b/lua/kankys/hlchunk.lua new file mode 100644 index 0000000..3e8ce6e --- /dev/null +++ b/lua/kankys/hlchunk.lua @@ -0,0 +1,11 @@ +require('hlchunk').setup({ + chunk = { + enable = true + -- ... + }, + indent = { + enable = true + -- ... + } +} +) diff --git a/lua/kankys/init.lua b/lua/kankys/init.lua new file mode 100644 index 0000000..b19a595 --- /dev/null +++ b/lua/kankys/init.lua @@ -0,0 +1,4 @@ +require('kankys/gitsigns') +require('kankys/hlchunk') +require('kankys/autoclosetag') +require('kankys/treesitter') diff --git a/lua/kankys/treesitter.lua b/lua/kankys/treesitter.lua new file mode 100644 index 0000000..e0e4889 --- /dev/null +++ b/lua/kankys/treesitter.lua @@ -0,0 +1,11 @@ +local treesitter = require('nvim-treesitter.configs') + +treesitter.setup { + highlight = { + enable = true + }, + indent = { + enable = true, + }, +} +