Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """""""""""""""""""""""""
- "Set VIM default encoding
- set encoding=utf-8
- """""""""""""""""""""""""
- call plug#begin('~/.local/share/nvim/plugged')
- Plug 'yuttie/comfortable-motion.vim'
- Plug 'scrooloose/nerdtree'
- Plug 'sjl/gundo.vim'
- Plug 'vim-syntastic/syntastic'
- Plug 'majutsushi/tagbar'
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'will133/vim-dirdiff'
- Plug 'chriskempson/tomorrow-theme', {'rtp': 'vim'}
- Plug 'szw/vim-maximizer'
- Plug 'drmingdrmer/vim-syntax-markdown'
- Plug 'christoomey/vim-tmux-navigator'
- Plug 'google/vim-searchindex'
- Plug 'tpope/vim-fugitive'
- Plug 'junegunn/fzf.vim'
- Plug 'junegunn/gv.vim'
- Plug 'airblade/vim-gitgutter'
- Plug 'jistr/vim-nerdtree-tabs'
- Plug 'junegunn/goyo.vim'
- Plug 'junegunn/limelight.vim'
- Plug 'junegunn/rainbow_parentheses.vim'
- Plug 'junegunn/seoul256.vim'
- Plug 'ncm2/ncm2'
- Plug 'roxma/nvim-yarp'
- Plug 'ncm2/ncm2-bufword'
- Plug 'ncm2/ncm2-path'
- Plug 'Shougo/neco-vim'
- Plug 'ncm2/ncm2-vim'
- Plug 'Shougo/neco-syntax'
- Plug 'ncm2/ncm2-syntax'
- Plug 'filipekiss/ncm2-look.vim'
- Plug 'ncm2/ncm2-jedi'
- Plug 'ncm2/ncm2-tern', {'do': 'npm install'}
- Plug 'ncm2/ncm2-pyclang'
- Plug 'HerringtonDarkholme/yats.vim'
- Plug 'mhartington/nvim-typescript', {'do': './install.sh'}
- call plug#end()
- """""""""""""""""""""""""
- "Get platfrom info.
- if has("unix")
- let s:uname = substitute(system('uname -s'), "\n", "", "")
- endif
- """""""""""""""""""""""""
- "General settings
- "For OS X
- if s:uname == "Darwin"
- "Begin for OS X
- set guifont=Monaco\ for\ Powerline:h12
- if has('gui_running')
- set transparency=0
- endif
- "End for OS X
- endif
- """""""""""""""""""""""""
- "fzf settings
- "fzf installed using Homebrew
- if s:uname == "Darwin"
- set rtp+=/usr/local/opt/fzf
- endif
- "fzf installed using Git under home
- set rtp+=~/.fzf
- "fzf layout
- let g:fzf_layout = { 'left': '~55%' }
- "Platform independent
- set number
- set ruler
- set showcmd
- set showmatch
- set laststatus=2
- set showtabline=4
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- syntax on
- set smartindent
- "Set search/line/column highlight
- set nohlsearch
- set nocursorline
- set nocursorcolumn
- set expandtab
- "Set indent guide
- "set list
- "set listchars=tab:┊\
- "help window open on right
- autocmd FileType help wincmd L
- "enable Rainbow Parentheses
- au VimEnter * RainbowParentheses
- """""""""""""""""""""""""""
- "Set Themes
- "Use light in GUI model, dark in CLI model
- if has('gui_running')
- colorscheme seoul256-light
- else
- colorscheme seoul256
- endif
- let g:airline_theme='zenburn'
- """""""""""""""""""""""""""
- "Plugins' options
- """""""""""""""""""""""""""
- "Set customize functions
- "Add spell check function
- let g:spell_check_opened = 0
- function! SpellCheckToggle()
- if g:spell_check_opened
- set nospell
- let g:spell_check_opened = 0
- else
- set spell spelllang=en_us
- let g:spell_check_opened = 1
- endif
- endfunction
- "Add function for execute current line
- function! ExecuteCurrentLine()
- let current_line=getline(".")
- silent put='--------'
- "silent put=''
- "silent call setline(".", "> ".current_line)
- "silent put='----'
- silent execute("r!" . current_line)
- silent put='---- End of Output ----'
- silent put=''
- silent put=''
- endfunction
- "Add function for searching certain word
- function! SearchWordInDirectory(word)
- echo 'Searching: ' . a:word
- let @/ =a:word
- let word="'" . a:word . "'"
- call fzf#run({
- \ 'source': 'ag -l ' . word,
- \ 'options': '--preview="pygmentize -g {} | ag --color --passthru ' . word . '"',
- \ 'sink': 'e',
- \ })
- endfunction
- "Add function for searching current word
- function! SearchCurrentWord()
- let current_word=expand("<cword>")
- call SearchWordInDirectory(current_word)
- endfunction
- "Add function for searching current word
- function! ShowAllBuffers()
- call fzf#run(fzf#wrap({
- \ 'source': map(range(1, bufnr('$')), 'bufname(v:val)'),
- \ }))
- endfunction
- """""""""""""""""""""""""""
- "Set customize shortcuts
- "Set leader
- let mapleader = ","
- "Map shortcuts for highlight search and cursor
- map <leader><space> :set hlsearch! cursorcolumn! cursorline!<CR>
- "Map shortcuts for fzf search word
- map <leader>* :call SearchCurrentWord()<CR>
- "Map tab shortcuts
- map <leader>n :tabe<CR>
- map <leader>t :tabe<CR>
- "Map shortcuts for close opeations
- map <leader>q :qa<CR>
- map <leader>w :q<CR>
- map <leader>`q :qa!<CR>
- map <leader>`w :q!<CR>
- "Map shortcuts for Maxmize and restore a window
- map <leader>m :MaximizerToggle<CR>
- "Map shortcuts for Tagbar
- map <leader>g :TagbarToggle<CR>
- "Map 'Check Grammar'
- map <leader>ck :SyntasticCheck<CR>
- "Map 'Spell Checking'
- map <leader>sc :call SpellCheckToggle()<CR>
- "Map ctrl+p to search files
- map <C-p> :FZF<CR>
- "Map ctrl+b to search buffers
- map <C-b> :call ShowAllBuffers()<CR>
- "Map ctrl+e in insert mode to execute cmd
- imap <C-e> <esc>:call ExecuteCurrentLine()<CR>i
- "Map shortcuts for NERDTree
- map <leader>ff :NERDTreeTabsToggle<CR>
- map <leader>f :NERDTreeTabsFind<CR>
- "Map shortcuts for distraction free mode
- autocmd! User GoyoEnter Limelight
- autocmd! User GoyoLeave Limelight!
- map <leader>d :Goyo<CR>
- map <leader>l :Limelight!!<CR>
- "Map ctrl+b/f in insert mode to navigate
- imap <C-b> <Left>
- imap <C-f> <Right>
- "Map 'Undo Graphic'
- let g:gundo_prefer_python3 = 1
- map <leader>z :GundoToggle<CR>
- "Map Run Current Script
- map <leader>e :call append(line(0), "#!/usr/bin/env " . &filetype)<CR>
- map <leader>r :!chmod a+x "%:p";"%:p"<CR>
- map <leader>cr :!chmod a+x "%:p";clear;"%:p"<CR>
- "Map capital K to find system manual in a new window
- runtime! ftplugin/man.vim
- nnoremap K :Man 3 <cword><CR>
- if s:uname=="SunOS"
- nnoremap K :Man -s 3c <cword><CR>
- endif
- "Set shortcuts for moving between window
- map <C-j> <C-w>j
- map <C-k> <C-w>k
- map <C-l> <C-w>l
- map <C-h> <C-w>h
- "Set cmdline navigation shortcuts
- cnoremap <C-a> <Home>
- cnoremap <C-e> <End>
- cnoremap <C-d> <Delete>
- cnoremap <C-p> <Up>
- cnoremap <C-n> <Down>
- cnoremap <C-b> <Left>
- cnoremap <C-f> <Right>
- "Set shortcut for moving between tab
- nnoremap _ :tabp<CR>
- nnoremap + :tabn<CR>
- """"""""""""""""""""""""""
- "Allow saving of files as sudo
- cmap w!! w !sudo tee % > /dev/null
- """"""""""""""""""""""""""
- "Searching word in workspace
- command -nargs=+ S :call SearchWordInDirectory(<q-args>)
- """"""""""""""""""""""""""
- "comfortable-motion.vim configuration
- let g:comfortable_motion_no_default_key_mappings = 1
- let g:comfortable_motion_friction = 5000
- let g:comfortable_motion_air_drag = 5.0
- nnoremap <silent> <C-d> :call comfortable_motion#flick(800)<CR>
- nnoremap <silent> <C-u> :call comfortable_motion#flick(-800)<CR>
- """"""""""""""""""""""""""
- "air-line
- let g:airline_powerline_fonts = 1
- if !exists('g:airline_symbols')
- let g:airline_symbols = {}
- endif
- "close nerdtree for gui
- let g:nerdtree_tabs_open_on_gui_startup = 0
- let g:ncm2_pyclang#library_path = '/usr/lib/x86_64-linux-gnu/libclang-3.9.so.1'
- " enable ncm2 for all buffers
- autocmd BufEnter * call ncm2#enable_for_buffer()
- set completeopt=noinsert,menuone,noselect
Add Comment
Please, Sign In to add comment