diff --git a/nvim/init.vim b/nvim/init.vim index 97bb5544..4805a8a7 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,15 +1,31 @@ -:set number -:set relativenumber -:set autoindent -:set tabstop=4 -:set shiftwidth=4 -:set smarttab -:set softtabstop=4 -:set mouse=a +let mapleader=" " + +set mouse=a +set number +set relativenumber +set autoindent +set smarttab +set ignorecase +set smartcase +set termguicolors +syntax on + +" Autocompletion +set wildmode=longest,list,full + +" Fix splitting +set splitbelow splitright + +"Tab settings +set expandtab +set shiftwidth=2 +set softtabstop=2 +set tabstop=2 + +set clipboard+=unnamedplus call plug#begin() -Plug 'vim-airline/vim-airline' Plug 'preservim/nerdtree' Plug 'ap/vim-css-color' Plug 'rafi/awesome-vim-colorschemes' @@ -34,13 +50,47 @@ Plug 'kyazdani42/nvim-web-devicons' call plug#end() colorscheme dracula + +set cursorline +set cursorcolumn +highlight CursorLine ctermbg=Yellow cterm=bold guibg=#2b2b2b +highlight CursorColumn ctermbg=Yellow cterm=bold guibg=#2b2b2b + nnoremap :NERDTreeToggle +" Verticaly center document when entering insert mode +autocmd InsertEnter * norm zz + +" Remove trailing whitespace on save +autocmd BufWritePre * %s/\s\+$//e + +" Enable Disable auto comment +map c :setlocal formatoptions-=cro +map C :setlocal formatoptions=cro + +" Enable spell checking, s for spell check +map s :setlocal spell! spelllang=en_us + +" Enable Disable auto indent +map i :setlocal autoindent +map I :setlocal noautoindent + +" Shortcutting split navigation +map h +map j +map k +map l + +" Moving line up or down by one line nmap :m -2 nmap :m -2 nmap :m +1 nmap :m +1 +" Alias replace all to S +nnoremap S :%s//gI + + " Use tab for trigger completion with characters ahead and navigate. inoremap \ pumvisible() ? "\" : @@ -58,6 +108,8 @@ else inoremap coc#refresh() endif + + lua << END require('Comment').setup() require('lualine').setup {