Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Set up Vundle to manage plugins
- set nocompatible
- filetype off
- " set the runtime path to include Vundle and initialize
- set rtp+=~/.vim/bundle/vundle/
- call vundle#rc()
- " let Vundle manage Vundle, required
- Plugin 'gmarik/vundle'
- " The following are examples of different formats supported.
- " Keep Plugin commands between here and filetype plugin indent on.
- " scripts on GitHub repos
- Plugin 'tpope/vim-fugitive'
- Plugin 'tpope/vim-repeat'
- Plugin 'tpope/vim-surround'
- Plugin 'tpope/vim-commentary'
- Plugin 'tpope/vim-haml'
- Plugin 'kchmck/vim-coffee-script'
- Plugin 'kien/ctrlp.vim'
- Plugin 'bling/vim-airline'
- Plugin 'altercation/vim-colors-solarized'
- Plugin 'jmcantrell/vim-virtualenv'
- Plugin 'davidoc/taskpaper.vim'
- Plugin 'gcmt/wildfire.vim'
- Plugin 'mattn/emmet-vim'
- Plugin 'vim-pandoc/vim-pandoc'
- Plugin 'vim-pandoc/vim-pandoc-syntax'
- Plugin 'vim-pandoc/vim-pandoc-after'
- Plugin 'christoomey/vim-tmux-navigator'
- Plugin 'rking/ag.vim'
- Plugin 'ervandew/supertab'
- Plugin 'Valloric/YouCompleteMe'
- Plugin 'SirVer/ultisnips'
- Plugin 'sjl/gundo.vim'
- Plugin 'edkolev/tmuxline.vim'
- Plugin 'edkolev/promptline.vim'
- " Local plugins
- filetype plugin indent on " required
- " Brief help
- " :PluginList - list configured plugins
- " :PluginInstall(!) - install (update) plugins
- " :PluginSearch(!) foo - search (or refresh cache first) for foo
- " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
- "
- " see :h vundle for more details or wiki for FAQ
- " NOTE: comments after Plugin commands are not allowed.
- " Put your stuff after this line
- " make YCM compatible with UltiSnips (using supertab)
- let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
- let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
- let g:SuperTabDefaultCompletionType = '<C-n>'
- " better key bindings for UltiSnipsExpandTrigger
- let g:UltiSnipsExpandTrigger = "<tab>"
- let g:UltiSnipsJumpForwardTrigger = "<tab>"
- let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
- " this mapping Enter key to <C-y> to chose the current highlight item
- " and close the selection list, same as other IDEs.
- " CONFLICT with some plugins like tpope/Endwise
- inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
- " Pandoc integration with third party plugins
- let g:pandoc#after#modules#enabled = ["supertab", "ultisnips"]
- let g:pandoc_no_folding = 1
- " Extends % switching between all kinds of matching object
- runtime macros/matchit.vim
- " Basic stuff
- set noswapfile
- set nobackup
- set encoding=utf-8
- set hidden
- set autoread " Read changes immediately if file changed outside vim
- set clipboard=unnamed " Use OS X clipboard
- syntax on
- " Theme
- set background=dark
- colorscheme solarized
- " Airline config
- let g:airline_powerline_fonts = 1
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
- let g:airline#extensions#tabline#fnamecollapse = 0
- let g:airline#extensions#virtualenv#enabled = 1
- let g:airline#extensions#tmuxline#enabled = 0
- let g:airline_inactive_collapse = 0
- let g:virtualenv_auto_activate = 1
- set laststatus=2
- " Emmet config
- let g:user_emmet_install_global = 0
- autocmd FileType html,css EmmetInstall
- let g:user_emmet_leader_key='<C-Z>'
- " Gundo config
- nnoremap <F5> :GundoToggle<CR>
- let g:gundo_preview_height = 20
- let g:gundo_preview_bottom = 1
- let g:gundo_close_on_revert = 1
- """""""""""""""""""""
- " tmuxline config "
- """""""""""""""""""""
- let g:tmuxline_theme = 'airline_insert'
- let g:tmuxline_preset = {
- \ 'a': '#S',
- \ 'b': '#F',
- \ 'c': '#W',
- \ 'win': ['#I', '#W'],
- \ 'cwin': ['#I', '#W'],
- \ 'x': '%a',
- \ 'y': ['%b %d', '%R'],
- \ 'z': '#h'}
- """""""""""""""""""""""
- " promptline config "
- """""""""""""""""""""""
- let g:promptline_theme = 'airline'
- let g:promptline_preset = {
- \'a': [ promptline#slices#python_virtualenv() ],
- \'b': [ promptline#slices#cwd({'dir_limit': 2}) ],
- \'c': [ promptline#slices#vcs_branch(), '$(git rev-parse --short HEAD 2>/dev/null)' ],
- \'x': [ promptline#slices#git_status() ],
- \'warn': [ promptline#slices#last_exit_code() ]}
- " Text Formatting
- " ----------------------------------------------------------------------------
- set autoindent " automatic indent new lines
- set smartindent " be smart about it
- set wrap " wrap lines
- set shiftwidth=4
- set tabstop=4
- set expandtab
- set softtabstop=4
- set smarttab
- set formatoptions+=n " support for numbered/bullet lists
- set virtualedit=block " allow virtual edit in visual block ..
- set linebreak
- set tw=500
- " ----------------------------------------------------------------------------
- " Remapping
- " ---------------------------------------------------
- " lead with ,
- let mapleader = " "
- let maplocalleader = ","
- " Fast save
- nnoremap <Leader>w :w!<cr>
- " reflow paragraph with Q in normal and visual mode
- nnoremap Q gqap
- vnoremap Q gq
- " make Y consistent with C and D. See :help Y.
- nnoremap Y y$
- " sane movement with wrap turned on
- nnoremap j gj
- nnoremap k gk
- vnoremap j gj
- vnoremap k gk
- " remap arrow keys
- nnoremap <left> :bprev<CR>
- nnoremap <right> :bnext<CR>
- nnoremap <up> :tabnext<CR>
- nnoremap <down> :tabprev<CR>
- " Help mode remapping
- " Enter to jump to link, Delete to go back
- " q to quit help
- autocmd filetype help nnoremap <buffer><cr> <c-]>
- autocmd filetype help nnoremap <buffer><bs> <c-T>
- autocmd filetype help nnoremap <buffer>q :q<CR>
- " ----------------------------------------------------------------------------
- " UI
- " ----------------------------------------------------------------------------
- set ruler " show the cursor position all the time
- set noshowcmd " don't display incomplete commands
- set nolazyredraw " turn off lazy redraw
- set number relativenumber " relative line numbers
- set wildmenu " turn on wild menu
- set wildmode=list:longest,full
- set ch=2 " command line height
- set backspace=2 " allow backspacing over everything in insert mode
- set whichwrap+=<,>,h,l,[,] " backspace and cursor keys wrap to
- set shortmess=filtIoOA " shorten messages
- set report=0 " tell us about changes
- set nostartofline " don't jump to the start of line when scrolling
- " ----------------------------------------------------------------------------
- " Visual Cues
- " ----------------------------------------------------------------------------
- set showmatch " brackets/braces that is
- set mat=5 " duration to show matching brace (1/10 sec)
- set incsearch " do incremental searching
- set laststatus=2 " always show the status line
- set ignorecase " ignore case when searching
- set hlsearch " don't highlight searches
- set visualbell
- " Disable highlight when <leader><cr> is pressed
- map <silent> <leader><cr> :noh<cr>
- " Toggle paste mode on and off
- map <leader>pp :setlocal paste!<cr>
- " Open Marked.app with current file
- nnoremap <leader>m :!open -b com.brettterpstra.marked2 %<CR>
- " Taskpaper settings
- "
- "let g:task_paper_styles={'today': 'ctermfg=Blue guifg=Blue'}
- " ---------------------------------------------------------------------------
- " Strip all trailing whitespace in file
- " ---------------------------------------------------------------------------
- " Delete trailing white space on save, useful for Python and CoffeeScript ;)
- func! DeleteTrailingWS()
- exe "normal mz"
- %s/\s\+$//ge
- exe "normal `z"
- endfunc
- autocmd BufWrite *.py :call DeleteTrailingWS()
- autocmd BufWrite *.coffee :call DeleteTrailingWS()
- " The Silver Searcher
- if executable('ag')
- " Use ag over grep
- set grepprg=ag\ --nogroup\ --nocolor
- " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
- let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
- " ag is fast enough that CtrlP doesn't need to cache
- let g:ctrlp_use_caching = 0
- endif
- " bind K to grep word under cursor
- nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
- map <Leader>s :call DeleteTrailingWS()<CR>
- " Special macros and abbreviations
- "
- " ISO date stamps
- iab <expr> dts strftime("%Y-%m-%d")
- cab <expr> dts strftime("%Y-%m-%d")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement