diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..9da6682 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,58 @@ +" Originally based on https://medium.com/better-programming/setting-up-neovim-for-web-development-in-2020-d800de3efacd +" Neovim plugins and setting +" Considerations, etc. COC: coc-emmet +" vim-fugitive, vim-gitgutter, vim-surround + +call plug#begin("~/.vim/plugged") + " Plugin Section + " Colour Scheme + Plug 'morhetz/gruvbox' + " File Explorer + Plug 'scrooloose/nerdtree' + Plug 'ryanoasis/vim-devicons' + " Fuzzy Finder + Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } + Plug 'junegunn/fzf.vim' + " COC + Plug 'neoclide/coc.nvim', {'branch': 'release'} + let g:coc_global_extensions = ['coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver'] + " Vim Move + Plug 'matze/vim-move' +call plug#end() + +" Add Vim Config +source ~/.vimrc + +" Config Section + +" Colour Scheme +if (has("termguicolors")) + set termguicolors +endif +syntax enable +colorscheme gruvbox + +" File Explorer +let g:NERDTreeShowHidden = 1 +let g:NERDTreeMinimalUI = 1 +let g:NERDTreeIgnore = [] +let g:NERDTreeStatusline = '' +" Automaticaly close nvim if NERDTree is only thing left open +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +" Toggle File Explorer +nnoremap :NERDTreeToggle + +" CoC +inoremap coc#refresh() + +" Fuzzy Finder +nnoremap :FZF +let g:fzf_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-s': 'split', + \ 'ctrl-v': 'vsplit' + \} + +" Vim Move +let g:move_key_modifier = 'C' + diff --git a/.vimrc b/.vimrc index 1e9d1c1..573a66d 100644 --- a/.vimrc +++ b/.vimrc @@ -3,8 +3,13 @@ set tabstop =4 " The amount of spaces per tab set shiftwidth =4 " The amount of spaces when shifting >> << syntax on " Syntax highlighting set number " Line numbers +set relativenumber " Relative lines numbers (also) set cursorline " Shows a line on the cursor's line +" Stop automatic comments on carriage +"set formatoptions-=cro +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + " Search settings set incsearch " Search as characters are entered set hlsearch " Highlight all matches