Last active
March 14, 2018 05:20
-
-
Save mikolasan/ab9a64a2ccf482dff2ab411420830922 to your computer and use it in GitHub Desktop.
Vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'bling/vim-airline' | |
Plugin 'vim-airline/vim-airline-themes' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'Xuyuanp/nerdtree-git-plugin' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'easymotion/vim-easymotion' | |
Plugin 'haya14busa/incsearch.vim' | |
Plugin 'haya14busa/incsearch-fuzzy.vim' | |
Plugin 'haya14busa/incsearch-easymotion.vim' | |
Plugin 'pangloss/vim-javascript' | |
Plugin 'flazz/vim-colorschemes' | |
" All of your Plugins must be added before the following line | |
call vundle#end() " required | |
filetype plugin indent on " required | |
" To ignore plugin indent changes, instead use: | |
"filetype plugin on | |
" | |
" Brief help | |
" :PluginList - lists configured plugins | |
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate | |
" :PluginSearch foo - searches for foo; append `!` to refresh local cache | |
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal | |
" | |
" see :h vundle for more details or wiki for FAQ | |
" Put your non-Plugin stuff after this line | |
syntax enable | |
set number | |
set relativenumber | |
colorscheme molokai | |
" NERDTree | |
map <C-n> :NERDTreeToggle<CR> | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" NERDTress File highlighting | |
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) | |
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg | |
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#' | |
endfunction | |
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515') | |
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515') | |
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515') | |
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515') | |
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515') | |
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515') | |
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515') | |
" Airline | |
let g:airline_theme='badcat' | |
let g:powerline_pycmd='py3' | |
let g:airline_powerline_fonts = 1 | |
" Syntastic | |
set statusline+=%#warningmsg# | |
set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
let g:syntastic_always_populate_loc_list = 1 | |
let g:syntastic_auto_loc_list = 1 | |
let g:syntastic_check_on_open = 1 | |
let g:syntastic_check_on_wq = 0 | |
let g:syntastic_cpp_checkers = [] | |
let g:syntastic_cpp_config_file = '.vim_syntax' | |
let g:syntastic_clang_tidy_config_file = '.vim_syntax' | |
let g:syntastic_cpp_check_header = 1 | |
filetype plugin indent on | |
" show existing tab with 4 spaces width | |
set tabstop=2 | |
" when indenting with '>', use 4 spaces width | |
set shiftwidth=2 | |
" On pressing tab, insert 4 spaces | |
set expandtab | |
set pastetoggle=<F2> | |
" Easymotion | |
" <Leader>f{char} to move to {char} | |
map <Leader>f <Plug>(easymotion-bd-f) | |
nmap <Leader>f <Plug>(easymotion-overwin-f) | |
" s{char}{char} to move to {char}{char} | |
nmap s <Plug>(easymotion-overwin-f2) | |
" Move to line | |
map <Leader>L <Plug>(easymotion-bd-jk) | |
nmap <Leader>L <Plug>(easymotion-overwin-line) | |
" Move to word | |
map <Leader>w <Plug>(easymotion-bd-w) | |
nmap <Leader>w <Plug>(easymotion-overwin-w) | |
function! s:config_easyfuzzymotion(...) abort | |
return extend(copy({ | |
\ 'converters': [incsearch#config#fuzzyword#converter()], | |
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})], | |
\ 'keymap': {"\<CR>": '<Over>(easymotion)'}, | |
\ 'is_expr': 0, | |
\ 'is_stay': 1 | |
\ }), get(a:, 1, {})) | |
endfunction | |
noremap <silent><expr> <Space>/ incsearch#go(<SID>config_easyfuzzymotion()) | |
" incsearch | |
map / <Plug>(incsearch-forward) | |
map ? <Plug>(incsearch-backward) | |
map g/ <Plug>(incsearch-stay) | |
map z/ <Plug>(incsearch-fuzzy-/) | |
map z? <Plug>(incsearch-fuzzy-?) | |
map zg/ <Plug>(incsearch-fuzzy-stay) | |
" Move lines | |
nnoremap <A-j> :m .+1<CR>== | |
nnoremap <A-k> :m .-2<CR>== | |
inoremap <A-j> <Esc>:m .+1<CR>==gi | |
inoremap <A-k> <Esc>:m .-2<CR>==gi | |
vnoremap <A-j> :m '>+1<CR>gv=gv | |
vnoremap <A-k> :m '<-2<CR>gv=gv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment