From 0c17dc91349a1e1ec6ad27417467ee64e304f509 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Sat, 25 Apr 2015 19:59:51 +0530 Subject: [PATCH] nvimrc Initial commit --- home/.nvim/nvimrc | 336 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 336 insertions(+) create mode 100644 home/.nvim/nvimrc diff --git a/home/.nvim/nvimrc b/home/.nvim/nvimrc new file mode 100644 index 0000000..39cc71a --- /dev/null +++ b/home/.nvim/nvimrc @@ -0,0 +1,336 @@ +" pathogen +" runtime bundle/pathogen/autoload/pathogen.vim +" execute pathogen#infect() + + +" This file is inspired by spf13's vimrc +syntax on + +if has('neovim') + let s:python_host_init = 'python -c "import neovim; neovim.start_host()"' + let &initpython = s:python_host_init + let &initclipboard = s:python_host_init + set unnamedclip " Automatically use clipboard as storage for the unnamed register +endif" +set t_Co=256 +" keyboard { +nmap :w +vmap gv +imap +map :TagbarToggle +nmap :waexe "mksession! " . v:this_session +set mouse=a +" cmap cwd lcd %:p:h +" cmap cd. lcd %:p:h +set timeout timeoutlen=1000 ttimeoutlen=100 +: " } + +" My settings { +filetype on " required! +set clipboard=unnamedplus +set history=1000 " Store a ton of history (default is 20) +set spell " Spell checking on +set hidden " Allow buffer switching without saving +set directory=~/.nvim/swap/ +filetype plugin indent on " Automatically detect file types. +let NERDSpaceDelims=1 +set listchars=tab:»\ ,eol:¶,trail:·,precedes:…,extends:… +" let g:xml_syntax_folding=1 +au FileType xml setlocal foldmethod=syntax +au FileType html setlocal foldmethod=syntax +set path=., +let javaScript_fold=1 " JavaScript +let perl_fold=1 " Perl +" let php_folding=1 " PHP +let r_syntax_folding=1 " R +let ruby_fold=1 " Ruby +let sh_fold_enabled=1 " sh +let vimsyn_folding='af' " Vim script +let xml_syntax_folding=1 " XML +autocmd FileType java set foldmethod=indent +autocmd FileType java set foldmethod=indent +autocmd FileType html set foldmethod=indent +nmap es :tabedit ~/.nvim/nvimrc +" Open current file's snippets file in a new tab +nmap en :execute 'OpenSnippets' +set noswapfile +" } + +" for moving tab { +nmap :execute 'tabmove ' . (tabpagenr()-2 ) +nmap :execute 'tabmove ' . tabpagenr() +nmap :execute 'Mt' . (tabpagenr() -1) +nmap :execute 'Mt' . (tabpagenr() +1) +" } + +" for formating { +" set nowrap " Wrap long lines +set autoindent " Indent at the same level of the previous line +set shiftwidth=4 " Use indents of 4 spaces +set expandtab " Tabs are spaces, not tabs +set tabstop=4 " An indentation every four columns +set softtabstop=4 " Let backspace delete indent +nmap tt :let &expandtab=!&expandtab +nmap tj :let &shiftwidth=&shiftwidth-2\|let &tabstop=&tabstop-2\|let &softtabstop=&softtabstop-2\|echo 'tabstop=' &tabstop +nmap tk :let &shiftwidth=&shiftwidth+2\|let &tabstop=&tabstop+2\|let &softtabstop=&softtabstop+2\|echo 'tabstop=' &tabstop +" } + +" for java { +autocmd BufRead *.java set include=^#\s*import +autocmd BufRead *.java set includeexpr=substitute(v:fname,'\\.','/','g') +autocmd BufRead *.java set suffixesadd=.java,.xml +" } + + +" for UI { + +set showmode " Display the current mode +if has('statusline') + set laststatus=2 + " Broken down into easily includeable segments + set statusline=%w%h%m%r " Options + " set statusline+=%{fugitive#statusline()} " Git Hotness + " set statusline+=\ [%{&ff}/%Y] " Filetype + set statusline+=\ [%{winnr()}] " Filetype + set statusline+=%<%f\ " Filename + " set statusline+=\ [%{getcwd()}] " Current dir + set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info +endif + +set backspace=indent,eol,start " Backspace for dummies +set linespace=0 " No extra spaces between rows +set nu " Line numbers on +set showmatch " Show matching brackets/parenthesis +set hlsearch " Highlight search terms +set winminheight=0 " Windows can be 0 line high +set ignorecase " Case insensitive search +set smartcase " Case sensitive when uc present +set wildmenu " Show list instead of just completing +set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all. +set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too +set scrolljump=5 " Lines to scroll when cursor leaves screen +set scrolloff=3 " Minimum lines to keep above and below cursor +set list +" } + +"for Ctrl-P{ + +let g:ctrlp_user_command = {} +let g:ctrlp_working_path_mode = 0 +let g:ctrlp_show_hidden = 1 +" custom file/folder ignores +let g:ctrlp_custom_ignore = { + \ 'dir': '\v[\/](\.git|\.hg|\.svn|\.ve|node_modules)$', + \ 'file': '\v\.(o|pyc|class)$', + \ 'link': '', + \ } +"}" + + +"for Bundle { +set nocompatible " be iMproved +set rtp+=~/.nvim/bundle/vundle/ +call vundle#rc() +" let Vundle manage Vundle +" required! +" Bundle 'Rykka/localbundle.vim' +Bundle 'gmarik/vundle' +" Bundle 'jelera/vim-javascript-syntax' +Bundle 'Lokaltog/vim-distinguished' +" Bundle 'vim-scripts/SyntaxRange' +" Bundle 'chrisbra/NrrwRgn' +Bundle 'harish2704/vim-snippets' +Bundle 'git://github.com/maxbrunsfeld/vim-yankstack.git' +Bundle 'vim-scripts/AutoComplPop' +" Bundle 'Valloric/YouCompleteMe' +" Bundle 'marijnh/tern_for_vim' +" Bundle 'briancollins/vim-jst' +" Bundle 'vim-scripts/EasyGrep' +Bundle 'heavenshell/vim-jsdoc' +" Bundle 'mustache/vim-mode' +Bundle 'AndrewRadev/vim-eco' +Bundle 'kchmck/vim-coffee-script' +Bundle 'harish2704/harish2704-vim' +Bundle 'scrooloose/nerdtree' +Bundle 'spf13/vim-autoclose' +Bundle 'godlygeek/tabular' +Bundle 'kien/ctrlp.vim' +Bundle 'vim-scripts/sessionman.vim' +Bundle 'nathanaelkane/vim-indent-guides' +Bundle 'MarcWeber/vim-addon-mw-utils' +Bundle 'tomtom/tlib_vim' +Bundle 'garbas/vim-snipmate' +Bundle 'scrooloose/nerdcommenter' +Bundle 'scrooloose/syntastic' +Bundle 'vim-scripts/DoxygenToolkit.vim' +Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} +Bundle 'Lokaltog/vim-easymotion' +Bundle 'tpope/vim-surround' +" Bundle 'floobits/floobits-neovim' +" Bundle 'tpope/vim-fugitive' + +" My Bundles here: +" +" original repos on github +" vim-scripts repos +" Bundle 'L9' +" Bundle 'FuzzyFinder' +" Bundle 'git://git.wincent.com/command-t.git' +" Bundle 'vim-scripts/Auto-Pairs' +" Bundle 'Raimondi/delimitMate.git' +" Bundle 'bkad/CamelCaseMotion' +" Bundle 'vim-scripts/boxdraw' +" Bundle 'vim-scripts/Vim-JDE' +" Bundle 'maksimr/vim-jsbeautify' +" Bundle 'pangloss/vim-javascript' +" Bundle 'amiorin/vim-project' +" Bundle 'flazz/vim-colorschemes' +" Bundle 'leshill/vim-json' +Bundle 'majutsushi/tagbar' +" Bundle 'amirh/HTML-AutoCloseTag' +" Bundle 'Shougo/eocomplcache' +" Bundle 'Shougo/neocomplcache' +" Bundle 'digitaltoad/vim-jade' +" Bundle 'vim-scripts/JavaScript-Indent' +" Bundle 'git://github.com/vim-scripts/autoload_cscope.vim.git' +" Bundle 'int3/vim-taglist-plus' +" Bundle 'vim-scripts/matchit.zip' +" Bundle 'vim-scripts/adt.vim' +" Bundle 'tpope/eclim' +" Source support_function.nvim to support vim-snippets. +if filereadable(expand("~/.nvim/bundle/vim-snippets/snippets/support_functions.vim")) + source ~/.nvim/bundle/vim-snippets/snippets/support_functions.vim +endif + +" if isdirectory(expand('~/.nvim/bundle/localbundle.vim')) + " call localbundle#init() +" endif +" } + +" for JS { +let g:html_indent_inctags = "html,body,head,tbody" +let g:html_indent_script1 = "inc" +let g:html_indent_style1 = "inc" +" } + + +" AutoCloseTag { +" Make it so AutoCloseTag works for xml and xhtml files as well +au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim +nmap ac ToggleAutoCloseMappings +" } +" NerdTree { +map :NERDTreeToggle:NERDTreeMirror +map e :NERDTreeFind +nmap nt :NERDTreeFind + +let NERDTreeShowBookmarks=1 +let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr'] +let NERDTreeChDirMode=0 +let NERDTreeQuitOnOpen=1 +let NERDTreeMouseMode=2 +let NERDTreeShowHidden=1 +let NERDTreeKeepTreeInNewTab=1 +let g:nerdtree_tabs_open_on_gui_startup=0 +" } + +" 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 / +" } + +" Session List { +set sessionoptions=blank,buffers,curdir,tabpages,winsize,resize,winpos +" nmap c :JavaCorrect +" nmap pt :ProjectsTree +nmap sl :SessionList +nmap sc :SessionClose +" } + +" JSON { +nmap jt :%!python -m json.tool:set filetype=json +" } + +" for JavaScript syntax checking { +let g:syntastic_javascript_checkers = ['jslint'] +" } + +"for easy quote/unquote { +nmap dQ ds" +nmap aQ ysiw" +nmap dq ds' +nmap aq ysiw' +" } + +" gides { +" let g:indent_guides_start_level = 2 +let g:indent_guides_guide_size = 1 +let g:indent_guides_enable_on_vim_startup = 1 +" } +" colorscheme colorful256 +" colorscheme mrkn256 +set wrap +" colorscheme desert256 +" colorscheme 256-grayvim +" colorscheme jellybeans +colorscheme distinguished +" set foldmethod=syntax +" let javascriptfold=1 +let g:indent_guides_auto_colors = 0 +hi IndentGuidesEven ctermbg=235 +hi IndentGuidesOdd ctermbg=240 +hi StatusLine ctermbg=202 +hi StatusLineNC ctermbg=246 ctermfg=0 +autocmd ColorScheme * hi IndentGuidesEven ctermbg=235 | hi IndentGuidesOdd ctermbg=240 + +set cursorline " Highlight current line +set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace +let g:ycm_key_list_select_completion = [ ''] +imap snipMateNextOrTrigger +nmap k +nmap j +nmap l +nmap h + +map 1 1gt +map 2 2gt +map 3 3gt +map 4 4gt +map 5 5gt +map 6 6gt +map 7 7gt +map 8 8gt +set lazyredraw +set ttyfast + + +imap ± 1gti +imap ² 2gti +imap ³ 3gti +imap ´ 4gti +imap µ 5gti +imap ¶ 6gti +imap · 7gti +imap ¸ 8gti + +map ± 1gt +map ² 2gt +map ³ 3gt +map ´ 4gt +map µ 5gt +map ¶ 6gt +map · 7gt +map ¸ 8gt + +imap A;