From 20f906b11a3ea1bd5f51729b80a74af1e7f41469 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Sat, 3 Dec 2016 01:18:48 +0530 Subject: [PATCH] Updates --- home/.config/nvim/init.vim | 98 ++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index adea83d..b37084f 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -5,6 +5,7 @@ set mouse=a " Cd to current file's directory +command! Header :execute '0r!file-header %' command! Cwd :execute 'cd %:p:h' command! Reload :execute "bufdo execute 'checktime . bufnr('%')'" @@ -56,6 +57,7 @@ autocmd BufRead *.java set include=^#\s*import autocmd BufRead *.java set includeexpr=substitute(v:fname,'\\.','/','g') autocmd BufRead *.java set suffixesadd=.java,.xml autocmd BufRead *.ect set suffixesadd=.ect ft=html.ect +autocmd BufRead *.njk set ft=jinja autocmd BufEnter *.gradle set ft=groovy " } @@ -119,7 +121,7 @@ let b:javascript_fold = 0 " For JSX { - let g:jsx_ext_required = 0 + " let g:jsx_ext_required = 0 "} @@ -138,6 +140,9 @@ let NERDTreeKeepTreeInNewTab=1 let g:nerdtree_tabs_open_on_gui_startup=0 " } +:let g:NERDCustomDelimiters = { +\ 'jinja': { 'left': '{# ', 'right': ' #}', 'leftAlt': '{# ', 'rightAlt': ' #}' } +\ } " Session List { set sessionoptions=blank,buffers,curdir,tabpages,winsize,resize,winpos @@ -147,9 +152,9 @@ set sessionoptions=blank,buffers,curdir,tabpages,winsize,resize,winpos " for JavaScript syntax checking { -let g:syntastic_javascript_checkers = ['eslint'] +" let g:syntastic_javascript_checkers = ['eslint'] let g:syntastic_always_populate_loc_list = 1 -" let g:syntastic_javascript_checkers = ['jslint'] +let g:syntastic_javascript_checkers = ['jshint'] " } @@ -164,10 +169,12 @@ set cursorline " Highlight current line set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace -" let Gtags_Auto_Map = 1 -let Gtags_VerticalWindow = 1 -let Gtags_Auto_Update = 1 -let GtagsCscope_Auto_Load = 1 +" for Gtags { +let g:Gtags_Auto_Map = 1 +let g:Gtags_VerticalWindow = 1 +let g:Gtags_Auto_Update = 1 +let g:GtagsCscope_Auto_Load = 1 +" } " set lazyredraw @@ -193,25 +200,6 @@ let g:fzf_action = { \ 'ctrl-x': 'split', \ 'ctrl-v': 'vsplit' } -" : close popup and save indent. -" inoremap =my_cr_function() -let s:ss=0 -let g:ss="" -function! s:my_cr_function() - if pumvisible() - let g:ss .= synIDattr( synID( line(".") , col("."), 1), "name") . ' - ' - " let g:ss .= col(".") . ' ' . virtcol(".") .' - ' - if s:ss == 1 - let s:ss = 0 - return "\" - else - let s:ss = 1 - return "\" - endif - else - return "\" - endif -endfunction let nvim_conf_root='~/.config/nvim/' call plug#begin( ) @@ -219,7 +207,7 @@ call plug#begin( ) " " original repos on github Plug 'tpope/vim-fugitive' -Plug 'Lokaltog/vim-easymotion' +" Plug 'Lokaltog/vim-easymotion' " Plug 'Lokaltog/vim-distinguished' " Plug 'junegunn/seoul256.vim' " Plug 'whatyouhide/vim-gotham' @@ -240,7 +228,7 @@ Plug 'scrooloose/syntastic' Plug 'pangloss/vim-javascript' Plug 'mxw/vim-jsx' " Plug 'othree/yajs.vim' -Plug 'harish2704/tern_for_vim' , { 'for': 'javascript' } +" Plug 'harish2704/tern_for_vim' , { 'for': 'javascript' } Plug 'scrooloose/nerdcommenter' Plug 'garbas/vim-snipmate' " Plug 'amiorin/vim-project' @@ -265,7 +253,7 @@ Plug 'Shougo/deoplete.nvim', { 'do': function('DoRemote') } " Plug 'Shougo/eocomplcache' Plug 'spf13/vim-autoclose' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeFind' } -Plug 'git@github.com:harish2704/harish2704-vim' +Plug 'harish2704/harish2704-vim' Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' } Plug 'digitaltoad/vim-jade', { 'for': 'jade' } Plug 'AndrewRadev/vim-eco', { 'for': [ 'ect', 'eco' ] } @@ -281,7 +269,7 @@ Plug 'heavenshell/vim-jsdoc', { 'for': 'javascript' } " Plug 'vim-scripts/EasyGrep' Plug 'briancollins/vim-jst', { 'for': 'jst' } Plug 'vim-scripts/matchit.zip' -Plug 'git@github.com:harish2704/vim-snippets.git' +Plug 'harish2704/vim-snippets' " Plug 'vim-scripts/SyntaxRange' Plug 'harish2704/gtags.vim' " Plug 'vim-scripts/guicolorscheme.vim' @@ -290,7 +278,7 @@ Plug 'harish2704/gtags.vim' " Plug 'tpope/eclim' Plug 'tomasr/molokai' Plug 'joonty/vdebug' -Plug 'junegunn/fzf', { 'dir': '~/.local/Apps/fzf' } +Plug 'junegunn/fzf', { 'dir': '/opt/fzf' } Plug 'junegunn/fzf.vim' Plug 'vim-scripts/SyntaxComplete' Plug 'justinj/vim-react-snippets' @@ -298,6 +286,10 @@ Plug 'othree/javascript-libraries-syntax.vim' Plug 'Glench/Vim-Jinja2-Syntax' Plug 'kannokanno/previm' Plug 'tyru/open-browser.vim' +Plug 'harish2704/MatchTag' +Plug 'leafgarland/typescript-vim' +Plug 'zenbro/mirror.vim' +Plug 'kassio/neoterm' call plug#end() " Source support_function.vim to support vim-snippets. @@ -356,9 +348,10 @@ imap " Replace grep with silver-searcher set grepprg=ag\ --nogroup\ --nocolor +" set grepprg=grep\ -n\ $*\ /dev/null " Ctrl-Enter on normal mode -> Jump to definition using Tern -autocmd BufEnter *.js nmap :TernDefSplit +" autocmd BufEnter *.js nmap :TernDefSplit " Ctrl-/ on normal mode -> Grep word under cursor ( Recursive ) nmap  :grep! -r @@ -387,7 +380,7 @@ nmap :bd " map :TagbarToggle nmap :waexe "mksession! " . v:this_session " \\es Open vimrc in a new tab -execute( 'nmap es :tabedit '. g:nvim_conf_root .'nvimrc ' ) +execute( 'nmap es :tabedit '. g:nvim_conf_root .'init.vim ' ) " \\en Open current file's snippets file in a new tab nmap en :execute 'OpenSnippets' @@ -497,25 +490,38 @@ nmap nt :NERDTreeFind " Tabularize { -nmap a& :Tabularize /& -vmap a& :Tabularize /& -nmap a= :Tabularize /= -vmap a= :Tabularize /= -nmap a: :Tabularize /: -vmap a: :Tabularize /: -nmap a:: :Tabularize /:\zs -vmap a:: :Tabularize /:\zs -nmap a, :Tabularize /, -vmap a, :Tabularize /, -vmap a// :Tabularize /\/\/ -nmap a :Tabularize / -vmap a :Tabularize / +" nmap a& :Tabularize /& +" vmap a& :Tabularize /& +" nmap a= :Tabularize /= +" vmap a= :Tabularize /= +" nmap a: :Tabularize /: +" vmap a: :Tabularize /: +" nmap a:: :Tabularize /:\zs +" vmap a:: :Tabularize /:\zs +" nmap a, :Tabularize /, +" vmap a, :Tabularize /, +" vmap a// :Tabularize /\/\/ +" nmap a :Tabularize / +" vmap a :Tabularize / " } " For terminal mode{ tmap " } +" For NeoTerm plugin{ +nmap o :Topen +nmap c :Tclose +" } +" For Open a terminal in current directory{ +nmap t :!gnome-terminal +nmap g :!git gui & +" } " -> Reload current file nmap :e! + +" force Close buffer +nmap :bd! +vmap "fy:%s#f# +