Skip to content

Instantly share code, notes, and snippets.

@ZenToad
Created November 27, 2018 17:31
Show Gist options
  • Save ZenToad/b1c20b23b703aadbce440c27dfc48c2c to your computer and use it in GitHub Desktop.
Save ZenToad/b1c20b23b703aadbce440c27dfc48c2c to your computer and use it in GitHub Desktop.
2018 .vimrc RHEL7
silent !stty -ixon > /dev/null 2>/dev/null
" Here is the Vundle stuff
set nocompatible " be iMproved, required
filetype off " required
set path+=**
set wildmenu
let mapleader=","
" 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('$HOME/vimfiles/bundle')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'sickill/vim-monokai'
Plugin 'scrooloose/nerdtree'
Plugin 'Rename'
"Plugin 'xolox/vim-misc'
"Plugin 'xolox/vim-easytags'
Plugin 'Raimondi/delimitMate'
Plugin 'easymotion/vim-easymotion'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'danro/rename.vim'
Plugin 'mileszs/ack.vim'
Plugin 'vim-scripts/searchfold.vim'
Plugin 'Shougo/denite.nvim'
"Plugin 'plytophogy/vim-virtualenv'
" 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"
"
" End Vundle stuff
let g:searchfold_do_maps = 1
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"let g:easytags_dynamic_files = 1
"let g:easytags_async = 1
let g:ycm_always_populate_location_list = 1
let delimitMate_expand_cr = 1
let g:syntastic_filetype_map = { "html.mustache": "handlebars" }
set termwinscroll=40000
set termwinsize=16x0
set tags=./tags,tags;~/.vimtags
set nocompatible
if v:progname =~? "evim"
finish
endif
source $VIMRUNTIME/mswin.vim
syntax on
set encoding=utf-8
set nu
set background=dark
if has('gui_running')
" GUI colors
colorscheme monokai
set guifont=Monospace
"colorscheme solarized
else
" Non-GUI (terminal) colors
set termguicolors
colorscheme monokai
"colorscheme solarized
endif
set smartcase
set ignorecase
set autoread
au CursorHold * checktime
let c='a'
while c <= 'z'
exec "set <A-".c.">=\e".c
exec "imap \e".c." <A-".c.">"
let c = nr2char(1+char2nr(c))
endw
set timeout ttimeoutlen=50
nnoremap ; :
nnoremap q; q:
nnoremap <silent> <F9> :TagbarOpen fj<CR>
nnoremap <silent> <F6> ggVGy
nnoremap <silent> <leader>w :set nowrap!<CR>
nnoremap <silent> <leader>f <C-]>
nnoremap <silent> <leader>m :term make -C build<CR>
vnoremap // y/<C-R>"<CR>
nnoremap <C-H> <C-W>h
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <silent> <C-T> :tabnew<CR>
nnoremap <leader>/ :nohl<CR>
nnoremap <SPACE> o<ESC>
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
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
set tabstop=3
set shiftwidth=3
imap jk <Esc>
inoremap <C-K><C-B> <ESC>:NERDTreeToggle<CR>
nnoremap <C-K><C-B> <ESC>:NERDTreeToggle<CR>
nnoremap <leader>vs <ESC>:vsplit<CR>
nnoremap <leader>r :Denite file/rec buffer<CR>
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set backupcopy=yes
if has("vms")
set nobackup " do not keep a backup file, use versions instead
set noswapfile
else
set nobackup " keep a backup file
set noswapfile
endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
" Manage split
set splitbelow
set splitright
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
" Don't use Ex mode, use Q for formatting
map Q gq
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
" For full syntax highlighting:
let python_highlight_all=1
syntax on
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
set hlsearch
endif
""python with virtualenv support
"py << EOF
"import os
"import sys
"if 'VIRTUAL_ENV' in os.environ:
"project_base_dir = os.environ['VIRTUAL_ENV']
"activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
"execfile(activate_this, dict(__file__=activate_this))
"EOF
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
autocmd BufNewFile,BufRead *.cycss set syntax=css
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
au BufNewFile,BufRead *.js,*.html,*.css
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2
" Define BadWhitespace before using in a match
"highlight BadWhitespace ctermbg=red guibg=darkred
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment