Skip to content

Instantly share code, notes, and snippets.

@deniszh
Created September 30, 2014 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deniszh/b39ff495dfb2a1b2a00c to your computer and use it in GitHub Desktop.
Save deniszh/b39ff495dfb2a1b2a00c to your computer and use it in GitHub Desktop.
My .vimrc
scriptencoding utf-8
set encoding=utf-8
set nocompatible " use vim default
syntax on
set background=dark
colorscheme delek
set t_Co=256
set list
set listchars=eol:¶,extends:>,precedes:<,nbsp:·,tab:\|_,trail:.
set hidden " http://nvie.com/posts/how-i-boosted-my-vim/
set nowrap " don't wrap lines
set ls=2 " allways show status line
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set showcmd " display incomplete commands
set hlsearch " highlight searches
set pastetoggle=<F2>
" paste mode mapped to F2
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set incsearch " do incremental searching
set ruler " show the cursor position all the time
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
set nobackup " do not keep a backup file
set number " show line numbers
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set title " show title in console title bar
set ttyfast " smoother changes
"set ttyscroll=0 " turn off scrolling, didn't work well with PuTTY
set modeline " last lines in document sets vim mode
set modelines=3 " number lines checked for modelines
set shortmess=atI " Abbreviate messages
set nostartofline " don't jump to first character when paging
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
set mouse=a
map <F5> :setlocal spell! spelllang=en_us<CR>
" spelling mapped to F5
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
autocmd filetype html,xml set listchars-=tab:\|\
au BufRead,BufNewFile *py,*pyw,*.c,*.h,*.css set tabstop=4
au BufRead,BufNewFile *.py,*pyw,*.css set shiftwidth=4
au BufRead,BufNewFile *.py,*.pyw,*.css set expandtab
au BufRead,BufNewFile Makefile* set noexpandtab
highlight BadWhitespace ctermbg=red
au BufRead,BufNewFile *.py,*.pyw,*.pp match BadWhitespace /^\t\+/
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.pp match BadWhitespace /\s\+$/
au FileType * autocmd BufWritePre <buffer> :%s/\s\+$//e
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=800
au BufNewFile *.py,*.pyw,*.c,*.h,*.pp set fileformat=unix
"" vim-plug config below
""
"" See https://github.com/junegunn/vim-plug
"" mkdir -p ~/.vim/autoload
"" curl -fLo ~/.vim/autoload/plug.vim \
"" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/tpope/vim-sensible'
Plug 'https://github.com/tpope/vim-fugitive'
Plug 'https://github.com/rodjek/vim-puppet'
Plug 'https://github.com/vim-ruby/vim-ruby'
Plug 'https://github.com/bling/vim-airline'
Plug 'https://github.com/godlygeek/tabular'
Plug 'https://github.com/scrooloose/syntastic'
Plug 'https://github.com/scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
call plug#end()
"let g:syntastic_puppet_puppetlint_args='--no-80chars-check'
"let g:syntastic_puppet_checkers=['puppet','puppetlint']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment