From b72c55b875288889c3fff0e7afc378a3bff83ab3 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 28 Feb 2020 02:06:26 +0100 Subject: [PATCH] current state of things --- vimrc | 102 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 84 insertions(+), 18 deletions(-) diff --git a/vimrc b/vimrc index fc92aba..fc4cb74 100644 --- a/vimrc +++ b/vimrc @@ -2,7 +2,7 @@ set nocompatible filetype off "required -"filetype plugin on " required +filetype plugin on " required inoremap pumvisible() ? "\" : "\" @@ -27,21 +27,33 @@ endif call plug#begin() Plug 'drewtempelmeyer/palenight.vim' -Plug 'https://github.com/suan/vim-instant-markdown', { 'for': 'markdown' } +Plug 'jacoborus/tender.vim' +Plug 'suan/vim-instant-markdown', { 'for': 'markdown' } Plug 'lervag/vimtex', { 'for': 'tex' } Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } -Plug 'https://tpope.io/vim/surround.git' -Plug 'https://github.com/tpope/vim-repeat.git' -"Plug 'https://github.com/tpope/vim-fugitive.git' -"Plug 'voldikss/vim-mma' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +Plug 'ctrlpvim/ctrlp.vim' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-repeat' +Plug 'Yggdroot/indentLine' +Plug 'cespare/vim-toml' +Plug 'preservim/nerdcommenter' +Plug 'preservim/nerdtree' +Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install tern' } +Plug 'vim-syntastic/syntastic' call plug#end() let g:airline_powerline_fonts = 1 let g:Powerline_symbols = "fancy" " sth like this probably set as a default but won't hurt here let g:airline_highlighting_cache = 1 +let g:airline_section_z = airline#section#create(['windowswap', '%3p%% ', 'linenr', ':%3v']) +let g:airline_theme = 'tender' let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' @@ -50,22 +62,66 @@ let g:gitgutter_terminal_reports_focus=0 "let g:gitgutter_async = 0 let g:gitgutter_sign_allow_clobber=0 -let g:deoplete#enable_at_startup = 1 +let g:deoplete#enable_at_startup = 0 let g:livepreview_cursorhold_recompile = 0 " vim-instant-markdown options -""let g:instant_markdown_allow_unsafe_content = 1 -""let g:instant_markdown_mathjax = 1 -""let g:instant_markdown_browser = "chromium-browser --incognito" -""let g:instant_markdown_autoscroll = 1 -""let g:instant_markdown_autostart = 1 +"let g:instant_markdown_allow_unsafe_content = 1 +let g:instant_markdown_mathjax = 1 +let g:instant_markdown_browser = 'chromium-browser --incognito' +let g:instant_markdown_autoscroll = 1 +let g:instant_markdown_autostart = 1 + +" Add spaces after comment delimiters by default +let g:NERDSpaceDelims = 1 +" Allow commenting and inverting empty lines (useful when commenting a region) +let g:NERDCommentEmptyLines = 1 +" Enable trimming of trailing whitespace when uncommenting +let g:NERDTrimTrailingWhitespace = 1 +"""" Enable NERDCommenterToggle to check all selected lines is commented or not +"""let g:NERDToggleCheckAllLines = 1 +" Add your own custom formats or override the defaults +let g:NERDCustomDelimiters = { 'vim': { 'left': '"','right': '' }, 'c': { 'left': '/**','right': '*/' } } + +"let g:indentLine_setColors = 0 +let g:indentLine_char_list = ['|', '¦', '┆', '┊', ':'] + +let g:syntastic_always_populate_loc_list = 0 +let g:syntastic_auto_loc_list = 2 +let g:syntastic_loc_list_height = 8 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 +let g:syntastic_aggregate_errors = 1 +let g:syntastic_id_checkers = 1 +let g:syntastic_error_symbol = "✗" +let g:syntastic_warning_symbol = "⚠" + +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_javascript_checkers = ['jsl'] +let g:syntastic_python_checkers = ['pylint'] +let g:syntastic_c_compiler = 'gcc' +let g:syntastic_c_check_header = 1 +let g:syntastic_c_auto_refresh_includes = 1 +let g:syntastic_cpp_check_header = 1 +let g:syntastic_cpp_auto_refresh_includes = 1 +let g:syntastic_c_cpplint_exec = 'cppcheck' + +" Use tern_for_vim. +" let g:tern#command = ["tern"] +" let g:tern#arguments = ["--persistent"] +" let g:deoplete#sources#ternjs#timeout = 1 +" Whether to include the types of the completions in the result data. Default: 0 +" let g:deoplete#sources#ternjs#types = 1 " change cursor shape for different editing modes, neovim does this by default if !has('nvim') if exists('$TMUX') - let &t_SI = "\Ptmux;\\e[5 q\\\" + let &t_SI = "\Ptmux;\\e[2 q\\\" let &t_SR = "\Ptmux;\\e[4 q\\\" let &t_EI = "\Ptmux;\\e[2 q\\\" else @@ -76,11 +132,16 @@ if !has('nvim') endif command! W execute 'silent w !sudo tee % >/dev/null' | edit! +command! -nargs=* Make write | make! | cwindow " open a terminal in $PWD nnoremap tt :terminal " toggle showing whitespace noremap :set list! +" make shortcut +nnoremap :make! +" NERDTree +nmap nt :NERDTreeToggle vmap gb :!git blame % -L=line("'<") ,=line("'>") nmap gb :!git blame % @@ -143,6 +204,10 @@ au BufWinLeave ?* mkview au BufWinEnter ?* silent loadview au FileType xml setlocal shiftwidth=2 tabstop=2 +au FileType html setlocal shiftwidth=2 tabstop=2 + +au BufNewFile,BufRead *.js + \ setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab autoindent fileformat=unix au FileType c setl ofu=ccomplete#CompleteCpp au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil* @@ -180,16 +245,16 @@ set errorformat+=%.%#PHP:\ %m\ \(in\ %f\ on\ line\ %l\)%.%#, autocmd BufNewFile,BufRead svn-commit.*tmp :0r $SVN_COMMIT_TEMPLATE -set tags=tags;/ +set tags=.tags; set incsearch " incrimental search set hlsearch " highlighting when searching -filetype indent plugin off +filetype indent plugin on set autoindent set backspace=2 -set listchars=trail:• +set listchars=trail:•,tab:>- set list " show/hide tabs and EOL chars (hidden characters) set confirm " ask confirmation like save before quit. set wildmenu " Tab completion menu when using command mode @@ -208,12 +273,13 @@ set nofoldenable "set foldmethod=indent " indent based folding set encoding=utf-8 " important for powerline besides others -set smartcase " override 'ignorecase' when pattern has upper case characters +set ignorecase " searches are case insensitive... +set smartcase " ... unless they contain at least one capital letter set noscrollbind set updatetime=1000 syntax enable -colo palenight " new fav highlighting +colo tender " new fav highlighting set mouse=a " enable mouse in n,v,i,c,h modes set laststatus=2 " show powerline status bar