Created
March 21, 2016 08:05
-
-
Save programisti/46bf9dff721abdfdc386 to your computer and use it in GitHub Desktop.
my personal neovim 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
" Note: Skip initialization for vim-tiny or vim-small. | |
" Required: | |
"set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
"endif | |
" Required: | |
call plug#begin() | |
" Required: | |
Plug 'Shougo/unite.vim' | |
Plug 'Shougo/vimfiler.vim' | |
Plug 'benekastah/neomake' | |
" NeoVim Plugins | |
Plug 'Shougo/deoplete.nvim' | |
Plug 'mhinz/vim-grepper' | |
" Plug plugins | |
Plug 'chriskempson/base16-vim' | |
Plug 'bling/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'kien/ctrlp.vim' | |
"Plug 'sjl/gundo.vim' | |
Plug 'simnalamburt/vim-mundo' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'mileszs/ack.vim' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'tpope/vim-endwise' | |
Plug 'tpope/vim-surround' | |
Plug 'moll/vim-bbye' | |
Plug 'godlygeek/tabular' | |
Plug 'plasticboy/vim-markdown' | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
"Programming languages | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'tpope/vim-rails' | |
Plug 'elixir-lang/vim-elixir' | |
Plug 'avdgaag/vim-phoenix' | |
Plug 'pangloss/vim-javascript' | |
Plug 'moll/vim-node' | |
Plug 'kchmck/vim-coffee-script' | |
"Template engines | |
"Plug 'slim-template/vim-slim.git' | |
Plug 'tpope/vim-haml' | |
"Plug 'digitaltoad/vim-jade.git' | |
Plug 'nono/vim-handlebars' | |
Plug 'othree/xml.vim' | |
call plug#end() | |
" Required: | |
filetype plugin indent on | |
" If there are uninstalled bundles found on startup, | |
" this will conveniently prompt you to install them. | |
let g:deoplete#enable_at_startup = 1 | |
filetype off " required | |
" No annoying sound on errors | |
set noerrorbells | |
if has('autocmd') | |
autocmd GUIEnter * set visualbell t_vb= | |
endif | |
" Use system clipboard | |
"set clipboard+=unnamedplus | |
" Leader key is space | |
let mapleader=" " | |
" required | |
set background=dark | |
filetype plugin indent on | |
syntax on | |
syntax enable | |
filetype on | |
filetype plugin on | |
filetype indent on | |
"""""""""""""""""""""""""""""""""""""""""" | |
" => VIM user interface | |
"""""""""""""""""""""""""""""""""""""""""" | |
" show line numbers | |
set number | |
" visual autocomplete for command menu | |
"set wildmenu | |
" highlight matching [{()}] | |
set showmatch | |
" Makes search act like search in modern browsers. search as characters are entered | |
set incsearch | |
" highlight matches | |
set hlsearch | |
" Make searching case insensitive | |
set ignorecase | |
" unless the query has capital letters. | |
set smartcase | |
" Incremental search. | |
set incsearch | |
" Use 'g' flag by default with :s/foo/bar/. | |
set gdefault | |
" Use 'magic' patterns (extended regular expressions). | |
set magic | |
" Use <C-L> to clear the highlighting of :set hlsearch. | |
if maparg('<C-L>', 'n') ==# '' | |
nnoremap <silent> <C-L> :nohlsearch<CR><C-L> | |
endif | |
" Always show statusline | |
set laststatus=2 | |
" Use 256 colours | |
set t_Co=256 | |
" show existing tab with 4 spaces width | |
set expandtab | |
set tabstop=2 | |
set shiftwidth=2 | |
" Set to auto read when a file is changed from the outside | |
set autoread | |
" Set 7 lines to the cursor - when moving vertically using j/k | |
set so=7 | |
" Height of the command bar | |
set cmdheight=1 | |
" Hide buffers | |
set hidden | |
" Disable wrapping | |
set nowrap | |
" Configure backspace so it acts as it should act | |
set backspace=eol,start,indent | |
set whichwrap+=<,>,h,l | |
" highlight the current line | |
"set cursorline | |
" Use ack instead of grep | |
set grepprg=ack | |
" Relative line numbers | |
"set relativenumber | |
" Set line-spacing to minimum. | |
set linespace=0 | |
" More natural splits | |
set splitbelow " Horizontal split below current. | |
set splitright " Vertical split to right of current. | |
" Colors cheme | |
colorscheme Tomorrow-Night | |
"colorscheme hybrid | |
let g:enable_bold_font = 0 | |
" Set utf8 as standard encoding and en_US as the standard language | |
set encoding=utf8 | |
" Tell Vim which characters to show for expanded TABs, | |
" trailing whitespace, and end-of-lines. VERY useful! | |
if &listchars ==# 'eol:$' | |
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ | |
endif | |
set list | |
" Also highlight all tabs and trailing whitespace characters. | |
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen | |
match ExtraWhitespace /\s\+$\|\t/ | |
"au BufNewFile,BufRead *.* set list listchars=eol:¬,tab:\▸\ ,trail:~,extends:>,precedes:< " Show invisible | |
"""""""""""""""""""""""""""""""""""""""""" | |
" => VIM plugins | |
"""""""""""""""""""""""""""""""""""""""""" | |
"========== airline | |
let g:airline#extensions#enabled = 1 | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#fnamemod = ':t' | |
let g:airline_powerline_fonts = 1 | |
let g:Powerline_symbols = 'fancy' | |
let g:airline_theme='luna' | |
set lazyredraw | |
set laststatus=2 " Always display the statusline in all windows | |
set showtabline=0 | |
"========== vimfiler Config | |
call unite#custom#default_action('directory', 'open') | |
let g:vimfiler_safe_mode_by_default = 0 | |
let g:vimfiler_as_default_explorer = 1 | |
let g:vimfiler_tree_leaf_icon = '' | |
let g:vimfiler_tree_opened_icon = '▾' | |
let g:vimfiler_tree_closed_icon = '▸' | |
let g:vimfiler_marked_file_icon = '✓' | |
let g:vimfiler_readonly_file_icon = '✗' | |
let g:vimfiler_file_icon = '' | |
let g:vimfiler_time_format = '%m-%d-%y %H:%M:%S' | |
let g:vimfiler_expand_jump_to_first_child = 0 | |
"let g:vimfiler_tree_opened_icon = "▼" | |
"let g:vimfiler_tree_closed_icon = "▷" | |
let g:vimfiler_enable_auto_cd = 1 | |
let g:vimfiler_quick_look_command = 'gloobus-preview' | |
autocmd FileType vimfiler setlocal nonu | |
call vimfiler#custom#profile('default', 'context', { | |
\ 'force_quit': 1, | |
\ 'safe': 0 | |
\ }) | |
map <C-n> :VimFilerExplorer -winwidth=30 -toggle -no-quit -simple<CR> | |
"nmap <C-n> :VimFilerBufferDir -explorer -find -winwidth=30 -toggle -no-quit -simple<CR> | |
"========== NerdTree Config | |
"map <C-n> :NERDTreeToggle<CR> | |
"noremap ,m :NERDTreeFind<CR> | |
"let g:NERDTreeWinSize=35 | |
"let NERDTreeQuitOnOpen=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 | |
"Give syntastic window smaller | |
"let g:syntastic_loc_list_height=5 | |
"========== Ctags | |
set tags=./tags; | |
let g:vim_tags_auto_generate = 1 " Tags will generate tags on file saving | |
let g:vim_tags_ignore_files = ['.gitignore', '.svnignore', '.cvsignore', 'logs'] | |
" fzf | |
"set rtp+=~/.fzf | |
"========== nerdcommenter | |
set timeout timeoutlen=1500 | |
"========== mundo | |
let g:mundo_width = 30 | |
let g:mundo_preview_height = 20 | |
"let g:gundo_left = 1 | |
let g:mundo_preview_bottom = 1 | |
"========== Swap files dirs | |
set backupdir=~/.vim/swap_files/backup// | |
set directory=~/.vim/swap_files/swap// | |
set undodir=~/.vim/swap_files/undo// | |
"========== Key mappings | |
noremap <Up> <nop> | |
noremap <Down> <nop> | |
noremap <Left> <nop> | |
noremap <Right> <nop> | |
"imap <Up> <nop> | |
"imap <Down> <nop> | |
"imap <Left> <nop> | |
"imap <Right> <nop> | |
" Autoformat | |
noremap <Leader>f \==<CR><CR> | |
" Quit file | |
noremap <Leader>q :q<CR><CR> | |
" Save quit file | |
noremap <Leader>w :w<CR><CR> | |
" Close file and delete from buffer | |
noremap <Leader>x :Bdelete <CR><CR> | |
" Toogle syntax checker | |
noremap <Leader>s :lclose <CR><CR> | |
" Tab navigation | |
noremap K :bnext <CR><CR> | |
noremap J :bprevious <CR><CR> | |
" Buffer navigation | |
noremap <Leader>k :tabnext<CR><CR> | |
noremap <Leader>j :tabprev<CR><CR> | |
" New Tab | |
noremap <C-t> :tabe <CR><CR> | |
" Toggle hilight | |
noremap <Leader>h :set hlsearch!<CR> | |
" CtrlP buffer tab | |
map <Leader>b :CtrlPBuffer<CR> | |
" Show Mundo | |
nnoremap <F3> :MundoToggle<CR> | |
" Open this file | |
map <F4> :tabe ~/.vimrc<CR> | |
" Easier split navigations | |
nnoremap <C-J> <C-W><C-J> | |
nnoremap <C-K> <C-W><C-K> | |
nnoremap <C-L> <C-W><C-L> | |
nnoremap <C-H> <C-W><C-H> | |
" Resize splits | |
noremap <Leader>rl :vertical resize -5<CR><CR> | |
noremap <Leader>rh :vertical resize +5<CR><CR> | |
noremap <Leader>rj :resize +5<CR><CR> | |
noremap <Leader>rk :resize -5<CR><CR> | |
" Grepper key binings | |
nnoremap <leader>git :Grepper -tool git -noswitch<cr> | |
nnoremap <leader>ag :Grepper -tool ag -grepprg ag --vimgrep -G '^.+\.txt'<cr> | |
nnoremap <leader>* :Grepper -tool ack -cword -noprompt<cr> | |
" Remove unwanted spaces | |
nnoremap <leader>d :%s/\s\+$//<cr> | |
set undofile | |
set exrc | |
set secure | |
set background=dark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment