Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Some of this from: http://stevelosh.com/blog/2010/09/coming-home-to-vim/
- filetype off
- call pathogen#runtime_append_all_bundles()
- filetype plugin indent on
- set nocompatible
- set modelines=0
- "Set tabstops to 4 spaces
- "set smartindent
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- set expandtab
- set encoding=utf-8
- set scrolloff=3
- set autoindent
- set showmode
- set showcmd
- set hidden
- set wildmenu
- set wildmode=list:longest
- set visualbell
- set cursorline
- set ttyfast
- set ruler
- set backspace=indent,eol,start
- set laststatus=2
- set relativenumber
- set undofile
- let mapleader = ","
- "nnoremap / /\v
- "vnoremap / /\v
- set ignorecase
- set smartcase
- set gdefault
- set incsearch
- set showmatch
- set hlsearch
- nnoremap <leader><space> :noh<cr>
- nnoremap <tab> %
- vnoremap <tab> %
- set wrap
- set textwidth=79
- set formatoptions=qrn1
- set colorcolumn=85
- " Shortcut to rapidly toggle `set list`
- "http://vimcasts.org/episodes/show-invisibles/
- nmap <leader>l :set list!<CR>
- set list
- "set listchars=tab:▸\ ,eol:¬
- set listchars=tab:▸\
- inoremap <F1> <ESC>
- nnoremap <F1> <ESC>
- vnoremap <F1> <ESC>
- "so i don't have to shift to enter colon
- nnoremap ; :
- "When window focus lost, save everything
- au FocusLost * :wa
- "Leader customizations
- ",W : strip trailing whitespace
- nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
- "Use Ack (I downloaded to plugin directory). grep replacement
- nnoremap <leader>a :Ack
- "in insert mode, two js in a row will get you back to normal mode.
- inoremap jj <ESC>
- "Make splitting windows not so clunky
- nnoremap <leader>w <C-w>v<C-w>l
- nnoremap <C-h> <C-w>h
- nnoremap <C-j> <C-w>j
- nnoremap <C-k> <C-w>k
- nnoremap <C-l> <C-w>l
- "Color schemes
- "-----------------------------------------------------------------------
- syntax enable
- "colorscheme midnightclouds
- "colorscheme molokai
- "if has('gui_running')
- "set background=light
- "else
- "set background=dark
- "endif
- "colorscheme solarized
- "-----------------------------------------------------------------------
- "Keys for yankring
- nnoremap <silent> <F4> :YRShow<cr>
- inoremap <silent> <F4> <ESC>:YRShow<cr>
- nnoremap <leader>Y :YRToggle<cr>
- "NERDTree shortcut
- nmap <leader>fe :NERDTree<cr>
- "Leader map for Rainbow parentheses
- nnoremap <leader>R :RainbowParenthesesToggle<CR>
- "Change horizontal splits to vertical
- nnoremap <leader>V <C-W>t<C-W>H<CR>
- "Quickly open a scratch buffer in vertical split
- nnoremap <leader>S :Sscratch<CR><C-W>t<C-W>H<CR>
- " When splitting window, open below or on right
- set splitbelow
- set splitright
- "Set to default to have line numbers
- "set number
- "Access system clipboard for OSX
- set clipboard=unnamed
- " Turn off beeping/bell
- set vb
- " Good settings found at:
- " http://www.slackorama.com/projects/vim/vimrc.html
- " select when using the mouse
- set selectmode=mouse
- " allow backspacing over everything in insert mode
- "set backspace=indent,eol,start
- "Command region height
- set cmdheight=2
- " do not keep a backup files
- set nobackup
- set nowritebackup
- " show the cursor position all the time
- "set ruler
- " do incremental searches (annoying but handy);
- "set incsearch
- " Show tab characters. Visual Whitespace.
- "set list
- "set listchars=tab:>.
- " Set ignorecase on
- "set ignorecase
- " smart search (override 'ic' when pattern has uppers)
- "set scs
- " Set 'g' substitute flag on
- "set gdefault
- " Set status line
- set statusline=[%02n]\ %f\ %(\[%M%R%H]%)%=\ %4l,%02c%2V\ %P%*
- " Always display a status line at the bottom of the window
- set laststatus=2
- " pressing < or > will let you indent/unident selected lines
- vnoremap < <gv
- vnoremap > >gv
- " Make tab in v mode work like I think it should (keep highlighting):
- "vmap <tab> >gv
- "vmap <s-tab> <gv
- " Map <c-s> to write current buffer.
- map <c-s> :w<cr>
- imap <c-s> <c-o><c-s>
- imap <c-s> <esc><c-s>
- " Buffer naviation
- map <M-Left> :bprevious<CR>
- map <M-Right> :bnext<CR>
- " Select all.
- map <c-a> ggVG
- " Undo in insert mode.
- imap <c-z> <c-o>u
- "switch to directory of current file
- command! CD cd %:p:h
- "Bindings
- "--------
- map <F2> :set wrap!<CR>
- "From http://stackoverflow.com/questions/953398/how-to-execute-file-im-editing-in-vim/
- nmap <F3> :w<CR>:silent !chmod +x %:p<CR>:silent !%:p 2>&1 \| tee ~/.vim/output<CR>:10split ~/.vim/output<CR>:redraw!<CR>
- " http://superuser.com/questions/35389/in-vim-how-do-i-make-the-left-and-right-arrow-keys-change-line
- " Arrow keys to go over newlines...
- set whichwrap+=<,>,[,]
- " http://stackoverflow.com/questions/102384/using-vims-tabs-like-buffers
- "set hidden
Advertisement
Add Comment
Please, Sign In to add comment