Skip to content

Instantly share code, notes, and snippets.

@domluna
Last active September 17, 2015 21:38
Show Gist options
  • Select an option

  • Save domluna/d849fc1f22b5fc91b112 to your computer and use it in GitHub Desktop.

Select an option

Save domluna/d849fc1f22b5fc91b112 to your computer and use it in GitHub Desktop.
old vimrc. Here just in case I miss something ....
" General
set encoding=utf-8
set fileencoding=utf-8
" Match and Search
set ignorecase
set smartcase
set hlsearch
set incsearch
" set autochdir
set tabstop=4
set softtabstop=4
set shiftwidth=4
set scrolloff=5
set t_Co=256
set clipboard+=unnamedplus
set backspace=indent,eol,start
set laststatus=2
set cmdheight=2
set showcmd
set ruler
set hidden
set history=500
set wrap
" Backup
set nobackup
set nowritebackup
set noswapfile
set autoread
set autowriteall
" ----------------------------------------------------------------
" Misc
" ----------------------------------------------------------------
" show a navigable menu for tab completion
set wildignore=.git,tmp/**,*.so,*.swp,*.zip,node_modules/**,log/**,*.class,*.o
" ----------------------------------------------------------------------------
" Space & Text related
" ----------------------------------------------------------------------------
set expandtab
set smarttab
set shiftround
set autoindent
set preserveindent
autocmd FocusLost * silent! :wa
autocmd TabLeave * silent!: wa
" Vundle stuff
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'Shougo/vimproc.vim'
Plugin 'Shougo/unite.vim'
Plugin 'Shougo/neomru.vim'
Plugin 'JuliaLang/julia-vim'
Plugin 'elzr/vim-json'
Plugin 'rust-lang/rust.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'fatih/vim-go'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-unimpaired'
Plugin 'pangloss/vim-javascript'
Plugin 'tomtom/tcomment_vim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 't9md/vim-transform'
Plugin 'dag/vim-fish'
Plugin 'zah/nim.vim'
Plugin 'vim-ruby/vim-ruby'
call vundle#end()
filetype plugin indent on
syntax on
" ----------------------------------------------------------------
" Globals
" ----------------------------------------------------------------
let g:syntastic_go_checkers = []
let g:syntastic_always_populate_loc_list = 1
let g:go_disable_autoinstall = 1
let g:go_fmt_command ="goimports"
set shell=/usr/local/bin/bash
" ----------------------------------------------------------------
" Colors
" ----------------------------------------------------------------
set background=dark
colo default
" colo Tomorrow-Night-Eighties
" colo Tomorrow-Night
" colo Tomorrow
hi Normal ctermbg=None
" TMUX stuff
if exists('$ITERM_PROFILE')
if exists('$TMUX')
let &t_SI = "\<Esc>[3 q"
let &t_EI = "\<Esc>[0 q"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
end
" Enable mouse support
set mouse=a
" Make shell editing faster
set ttyfast
" More natural splits
set splitbelow
set splitright
" -----------------
" Regular Mappings
" -----------------
let mapleader=","
nnoremap ; :
vnoremap ; :
" Select entire buffer
nnoremap gy :0,$ y<cr>
" Yank entire buffer
nnoremap vy ggVG
" Make Y behave like other capital commands.
" Hat-tip http://vimbits.com/bits/11
nnoremap Y y$
" Just to beginning and end of lines easier. From http://vimbits.com/bits/16
noremap H ^
noremap L $
"
" Create newlines without entering insert mode
nnoremap go o<Esc>k
nnoremap gO O<Esc>j
" remap U to <C-r> for easier redo
" from http://vimbits.com/bits/356
nnoremap U <C-r>
" Swap implementations of ` and ' jump to markers
" By default, ' jumps to the marked line, ` jumps to the marked line and
" column, so swap them
nnoremap ' `
nnoremap ` '
" Use very magic (Perl-like) regex style
nnoremap / /\v
vnoremap / /\v
" Don't move on *
nnoremap <silent> * :let stay_star_view = winsaveview()<cr>*:call winrestview(stay_star_view)<cr>
" ----------------
" Window Movement
" ----------------
nnoremap <silent> <Leader>j ddp
nnoremap <silent> <Leader>k ddkP
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
map <silent> j gj
map <silent> k gk
map <silent> <leader>c :TComment<cr>
map 0 ^
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
nnoremap Q <nop>
onoremap p i(
onoremap is i"
onoremap cb i{
onoremap sb i[
vnoremap > >gv
vnoremap < <gv
imap jj <ESC>
" Markdown support
autocmd BufRead,BufNewFile *.md set filetype=markdown
" Fix Cursor in TMUX
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" open go definitions in same window
let g:godef_split=0
" ag searches faster than grep or ack
if executable("ag")
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '--nogroup --nocolor --column'
let g:unite_source_grep_recursive_opt = ''
endif
" ---------------------------------------------------------------------------------
" Unite
" ---------------------------------------------------------------------------------
if exists("*unite")
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
call unite#set_profile('files', 'smartcase', 1)
call unite#custom#source('file_rec/async','sorters','sorter_rank')
endif
nnoremap <silent> <C-p> :Unite -start-insert -buffer-name=files -winheight=10 file_rec/async<CR>
" nnoremap <Leader>b :Unite -buffer-name=buffers -winheight=10 buffer<CR>
nnoremap <Leader>f :Unite grep:.<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment