" Managed plugins call plug#begin() " List your plugins here Plug 'tpope/vim-sensible' Plug 'tpope/vim-fugitive' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'bluz71/vim-moonfly-colors', { 'as': 'moonfly' } Plug 'flazz/vim-colorschemes' Plug 'vim-python/python-syntax' Plug 'preservim/nerdtree' | \ Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'preservim/tagbar' call plug#end() " desert feral gentooish grb256 jellygrass kalt last256 matrix colorscheme molokai " * User Interface " dark background, by default set background=dark " mouse selection set selectmode=mouse " No beeping, please... set vb " Display the current mode and partially-typed commands in the status line set showmode set showcmd " Highlight current line and disable highlighting in insert mode set cursorline " Statusline "set statusline=%f " File name "set statusline+=%y " File type "set statusline+=%m " Modified flag [+] if modified "set statusline+=%r " Read-only flag [RO] if read-only "set statusline+=%= " Right-align the next section "set statusline+=%l/%L " Current line / Total lines "set statusline+=\ [%p%%] " Percentage through the file "set statusline+=%c " Column number set laststatus=2 set showtabline=2 " ? set guioptions-=e " Reset statusline set statusline= " filename, relative to cwd set statusline+=%f " separator set statusline+=\ " modified flag set statusline+=%#wildmenu# set statusline+=%m set statusline+=%* "Display a warning if file encoding isnt utf-8 set statusline+=%#question# set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''} set statusline+=%* "display a warning if fileformat isnt unix set statusline+=%#directory# set statusline+=%{&ff!='unix'?'['.&ff.']':''} set statusline+=%* "display a warning if files contains tab chars set statusline+=%#warningmsg# set statusline+=%{StatuslineTabWarning()} set statusline+=%* " read-only set statusline+=%r set statusline+=%* " right-align set statusline+=%= " filetype set statusline+=[%{strlen(&ft)?&ft:'none'}] " separator set statusline+=\ " current char set statusline+=[%b],[0x%02B] " separator set statusline+=\ " column, set statusline+=(C:%2c), " current line / lines in file set statusline+=[%l/%L] " always show status line set laststatus=2 " return '[tabs]' if tab chars in file, or empty string function! StatuslineTabWarning() if !exists("b:statusline_tab_warning") let tabs = search('^\t', 'nw') != 0 if tabs let b:statusline_tab_warning = '[tabs]' else let b:statusline_tab_warning = '' endif endif return b:statusline_tab_warning endfunction " Recalculate the tab warning flag when idle and after writing autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning " Map Ctrl+n to :NERDTreeToggle map :NERDTreeToggle " Map F8 to :TagbarToggle map :TagbarToggle " Remember position in file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif " Set the clipboard so all vim instances share the same copy/paste buffer set clipboard=unnamed " Enable paste mode "set paste " Enable syntax highlighting syntax on " Show line numbers "set number " Set line number color " Get colors here: " http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim "highlight LineNr ctermfg=220 guifg=#ffd700 ""set t_Co=256 " Set 'nocompatible' to ward off unexpected things that your distro might " have made, as well as sanely reset options when re-sourcing .vimrc set nocompatible " Ensure utf-8 encoding set encoding=utf-8 " Code indentation syntax enable filetype plugin indent on set tabstop=4 set shiftwidth=4 set expandtab " set number " filetype indent on " set autoindent filetype indent off set noautoindent set nocindent set nosmartindent " Better command-line completion set wildmenu " have command-line completion (for filenames, help topics, option names) " first list the available options and complete the longest common part, then " have further s cycle through the possibilities set wildmode=list:longest,full " Highlight searches (use to temporarily turn off highlighting; see the " mapping of below) set hlsearch " Use case insensitive search, except when using capital letters set ignorecase set smartcase " Stop certain movements from always going to the first character of a line. " While this behaviour deviates from that of Vi, it does what most users " coming from other editors would expect. set nostartofline " Display the cursor position on the last line of the screen or in the status " line of a window set ruler " Instead of failing a command because of unsaved changes, instead raise a " dialogue asking if you wish to save changed files. set confirm " Allow hidden buffers set hidden " Automatically enable paste mode when pasting. " https://stackoverflow.com/questions/2514445/turning-off-auto-indent-when-pasting-text-into-vim/38258720#38258720 " https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode let &t_SI .= "\[?2004h" let &t_EI .= "\[?2004l" inoremap [200~ XTermPasteBegin() function! XTermPasteBegin() set pastetoggle=[201~ set paste return "" endfunction " * Load Additional Settings " OS-specific configuration loading let s:os=substitute(system('uname -s'), '\n', '', 'g') let s:osfile=$HOME . '/.vim/local/os-' . s:os . '.vim' if filereadable(s:osfile) execute 'source '. s:osfile endif " host-specific configuration loading let s:hostfile=$HOME . '/.vim/local/host-' . hostname() . '.vim' if filereadable(s:hostfile) execute 'source '. s:hostfile endif