diff --git a/vim/.vimrc b/vim/.vimrc index 5afa18c..03fe0b3 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,10 +1,17 @@ -" To get the full path you can add this command -" https://unix.stackexchange.com/a/111560/176830 -set statusline+=%F +call plug#begin() + +" List your plugins here +Plug 'preservim/nerdtree' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'junegunn/fzf.vim' -execute pathogen#infect() -" Uncomment the following line to start NERDTree on enter +call plug#end() + +" ===== NERDTree Configurations ===== + +" Uncomment the following line to start NERDTree on enter " autocmd vimenter * NERDTree " Show hiddle files in NERDTree @@ -17,19 +24,31 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isT nmap :NERDTreeToggle nmap :NERDTreeFind -" Make Ctrl-W a NOP in insert mode -" https://stackoverflow.com/a/69020234/2422530 -inoremap +" ===== NERDTree Configurations ===== + +" ===== fzf.vim Configurations ===== + +set rtp+=/opt/homebrew/opt/fzf " only for mac silicon +nnoremap :Files -" For Mac only +" ===== fzf.vim Configurations ===== + +" ===== Settings ===== +" To get the full path you can add this command +" https://unix.stackexchange.com/a/111560/176830 +set statusline+=%F set regexpengine=0 + " Colorscheme -colorscheme apprentice +set t_Co=256 +" set termguicolors syntax enable +" let g:solarized_termcolors=256 +" let g:solarized_termtrans = 1 set background=dark - -" Settings +" colorscheme apprentice +colorscheme retrobox " Set it to show Line numbers se nu set incsearch @@ -44,13 +63,9 @@ set smartindent set noswapfile " Wrapping config -set textwidth=80 -set colorcolumn=+1 - +" set textwidth=80 +" set colorcolumn=+1 -" ****************** Starting the vim script copied from https://github.com/neoclide/coc.nvim#example-vim-configuration - -" Set internal encoding of vim, not needed on neovim, since coc.nvim using some " unicode characters in the file autoload/float.vim set encoding=utf-8 @@ -61,109 +76,19 @@ set hidden set nobackup set nowritebackup -" Give more space for displaying messages. -set cmdheight=2 - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=300 - -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - -" Always show the signcolumn, otherwise it would shift the text each time -" diagnostics appear/become resolved. -if has("patch-8.1.1564") - " Recently vim can merge signcolumn and number column into one - set signcolumn=number -else - set signcolumn=yes -endif - -" ****************** Starting the vim script copied from https://github.com/kien/ctrlp.vim#basic-options - -let g:ctrlp_map = '' -let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_working_path_mode = 'ra' -" let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' -let g:ctrlp_custom_ignore = '\v[\/](\.(git|hg|svn)|(node_modules))$' - -" ****************** Closing the vim script copied from https://github.com/kien/ctrlp.vim#basic-options +" vim-airlime-theme configuration +" let g:airline_theme='dark' " Enabling the mouse support set mouse=a -" Enable folding the functions -set foldmethod=syntax -let javaScript_fold=1 -set foldcolumn=0 -set foldlevel=5 -set foldlevelstart=8 -set foldclose=all - -" Enable copy directly to system clipboard -set clipboard=unnamedplus - -" Setting up the statusline configuration -source ~/.vim/statusline.vim - " Autocompleting without any plugins " Source -> https://www.youtube.com/watch?v=2f8h45YR494 set complete+=kspell set completeopt=menuone,longest set shortmess+=c -" -> Navigate the complete menu items like CTRL+n / CTRL+p would. -inoremap pumvisible() ? "" :"" -inoremap pumvisible() ? "" : "" - -" -> Select the complete menu item like CTRL+y would. -inoremap pumvisible() ? "" : "" -inoremap pumvisible() ? "" :"" - -" Settings for tabline.vim -" https://github.com/mkitt/tabline.vim -" Found here -> https://github.com/drmingdrmer/vim-tabbar -" Previously using https://superuser.com/a/1203482/686983 -hi TabLine ctermfg=Green ctermbg=Black cterm=NONE -hi TabLineFill ctermfg=Grey ctermbg=Black cterm=NONE -hi TabLineSel ctermfg=Green ctermbg=Black cterm=NONE - - - -" Configurations for vim-lsc https://github.com/natebosch/vim-lsc -let g:lsc_server_commands = {'go': 'gopls'} - -" Complete default mappings are: -let g:lsc_auto_map = { - \ 'GoToDefinition': 'gd', - \ 'GoToDefinitionSplit': [']', ''], - \ 'FindReferences': 'gr', - \ 'NextReference': 'g', - \ 'PreviousReference': 'g', - \ 'FindImplementations': 'gi', - \ 'FindCodeActions': 'ga', - \ 'Rename': 'gR', - \ 'ShowHover': v:true, - \ 'DocumentSymbol': 'go', - \ 'WorkspaceSymbol': 'gS', - \ 'SignatureHelp': 'gm', - \ 'Completion': 'completefunc', - \} - - -" Settings for Code format -" https://github.com/google/vim-codefmt#autoformatting -" https://stackoverflow.com/a/40275194/2422530 -" NOTE: will require installation of the required dependencies -autocmd FileType rust setlocal equalprg=rustfmt -autocmd FileType go setlocal equalprg=gofmt - -" https://stackoverflow.com/a/59719162/2422530 -" NOTE: Needs the installation -> npm -g install js-beautify -autocmd FileType javascript setlocal equalprg=js-beautify\ -s\ 2\ - - " Setting the formatting for svelte to be same as html au! BufNewFile,BufRead *.svelte set ft=html @@ -176,7 +101,17 @@ au BufNewFile,BufRead *.py set tabstop=4 \ autoindent \ fileformat=unix -au BufNewFile,BufRead *.js,*.ts,*.html,*.svelte,*.css,*.scss set - \ tabstop=2 - \ softtabstop=2 +au BufNewFile,BufRead *.js,*.ts,*.html,*.svelte,*.css,*.scss set + \ tabstop=2 + \ softtabstop=2 \ shiftwidth=2 + +au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown + + +" augroup statusline +" autocmd! +" autocmd WinEnter,BufEnter * setlocal statusline=%!statusline#active() +" autocmd WinLeave,BufLeave * setlocal statusline=%!statusline#inactive() +" augroup end +" ===== Settings =====