From 3f39ff71f09fa99a874e822ea7157b1570ea6ba9 Mon Sep 17 00:00:00 2001 From: Vasili Svirydau Date: Thu, 16 Nov 2017 15:53:57 -0800 Subject: [PATCH] more changes --- config/01-plugins.vim | 26 ++++++++++++++++++-------- config/02-general.vim | 12 ++++++------ config/03-mappings.vim | 32 ++++++++++++++------------------ config/04-autocmds.vim | 12 ++++++++++++ vimrc | 4 ---- 5 files changed, 50 insertions(+), 36 deletions(-) diff --git a/config/01-plugins.vim b/config/01-plugins.vim index a5b55eb..b97a6ae 100644 --- a/config/01-plugins.vim +++ b/config/01-plugins.vim @@ -12,18 +12,20 @@ if(have_plug) call plug#begin(vim_files . '/plugged') Plug 'tpope/vim-sensible' " Sensible defaults for vim - Plug 'w0ng/vim-hybrid' " Hybrid colorscheme - Plug 'vim-airline/vim-airline' " Status bar - Plug 'vim-airline/vim-airline-themes' " Status bar themes - Plug 'ivyl/vim-bling' " blink search results + Plug 'ctrlpvim/ctrlp.vim' " Fuzzy search + Plug 'editorconfig/editorconfig-vim' " EditorConfig.org support + Plug 'ivyl/vim-bling' " blink search results + Plug 'rking/ag.vim' " Silver Searcher Support Plug 'tacahiroy/ctrlp-funky' " Fuzzy in-buffer search Plug 'tommcdo/vim-lion' " Align stuff + Plug 'tpope/vim-commentary' " Commenting Plug 'tpope/vim-fugitive' " Work with git repos Plug 'tpope/vim-surround' " Surround with quotes - Plug 'rking/ag.vim' " Silver Searcher Support - Plug 'tpope/vim-commentary' " Commenting - " Plug 'vimwiki/vimwiki' " http://vimwiki.github.io/ + Plug 'vim-airline/vim-airline' " Status bar + Plug 'vim-airline/vim-airline-themes' " Status bar themes + Plug 'vimwiki/vimwiki' " http://vimwiki.github.io/ + Plug 'w0ng/vim-hybrid' " Hybrid colorscheme " Language if executable('rails') @@ -37,6 +39,8 @@ if(have_plug) Plug 'quramy/vim-js-pretty-template' " Syntax highlight inside template strings Plug 'quramy/tsuquyomi' " Language server support for TypeScript + Plug 'heavenshell/vim-jsdoc' " Generate JSDoc comments + " Quality of life Plug 'edkolev/tmuxline.vim' @@ -55,4 +59,10 @@ if(have_plug) endif endif - +let g:loaded_netrwPlugin = 1 +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#ale#enabled = 1 +let g:ale_sign_column_always = 1 +let g:ale_sign_error = '' +let g:ale_sign_warning = '' diff --git a/config/02-general.vim b/config/02-general.vim index 9bc1596..556d624 100644 --- a/config/02-general.vim +++ b/config/02-general.vim @@ -7,19 +7,19 @@ set visualbell set wildmode=full set background=dark silent! colorscheme hybrid -let mapleader = '\' "Set before any key remapping +" let mapleader = '\' "Set before any key remapping set hlsearch "highlight search results set ignorecase "ignore capitalization set smartcase set cursorline "highlight current line set listchars=tab:▸\ ,eol:¬ "Invisible character colors -highlight NonText guifg=#4a4a59 -highlight SpecialKey guifg=#4a4a59 +" highlight NonText guifg=#4a4a59 +" highlight SpecialKey guifg=#4a4a59 "tab settings -set shiftwidth=4 -set tabstop=4 set expandtab +set shiftwidth=4 +set softtabstop=4 set backspace=2 "set sane backspace behaviour @@ -44,7 +44,7 @@ imap jk set completeopt=longest,menu,menuone " Stolen from maralla/dotvim -function! EnsureExists(path) +function! EnsureExists(path) abort if !isdirectory(expand(a:path)) call mkdir(expand(a:path)) endif diff --git a/config/03-mappings.vim b/config/03-mappings.vim index 6ff95b6..4c338b6 100644 --- a/config/03-mappings.vim +++ b/config/03-mappings.vim @@ -1,36 +1,32 @@ "open config with \r -nmap r :e $MYVIMRC -nmap w :up -imap w :upa +noremap r :edit $MYVIMRC +noremap w :update +inoremap w :updatea cmap w!! w !sudo tee % >/dev/null +cmap eh e %:h/ + "Remove search highlight when is pressed nnoremap :nohlsearch "toggle whitespace -nmap l :set list! +noremap l :set list! " noremap R :! echo reload \| nc -w 1 localhost 32000 noremap R :! tmux send-keys -t right "up" C-m "press space in normal mode to center screen -nmap zz -nmap ] :bn -nmap [ :bp -nmap d :bd +noremap zz +noremap ] :bn +noremap [ :bp +noremap d :bd -if(exists("g:loaded_ale")) - nmap e[ (ale_previous_wrap) - nmap e] (ale_next_wrap) -endif +nmap e[ (ale_previous_wrap) +nmap e] (ale_next_wrap) let g:tsuquyomi_javascript_support = 1 -if(exists("g:loaded_tsuquyomi")) - nmap p :echo tsuquyomi#hint() -endif +noremap p :echo tsuquyomi#hint() let g:ctrlp_funky_syntax_highlight = 1 -if(exists("g:loaded_ctrlp_funky")) - nnoremap f :CtrlPFunky -endif +nnoremap f :CtrlPFunky diff --git a/config/04-autocmds.vim b/config/04-autocmds.vim index b56c67e..e1169ae 100644 --- a/config/04-autocmds.vim +++ b/config/04-autocmds.vim @@ -1,6 +1,18 @@ if has("autocmd") filetype plugin indent on + augroup InvisibleCharsHighlight + au! + + autocmd ColorScheme * :call ResetColors() + + function! ResetColors() + "Invisible character colors + highlight NonText guifg=#4a4a59 + highlight SpecialKey guifg=#4a4a59 + endfun + augroup END + augroup CleanWhitespace au! autocmd BufWritePre * :call StripTrailingWhitespace() diff --git a/vimrc b/vimrc index 7ac34ad..b7c5b2c 100644 --- a/vimrc +++ b/vimrc @@ -13,8 +13,4 @@ call SourceConfig("02-general.vim") call SourceConfig("03-mappings.vim") call SourceConfig("04-autocmds.vim") -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#ale#enabled = 1 - unlet g:vim_files