2014-02-24 15:21:54 +00:00
|
|
|
|
" Neobundle Setup
|
|
|
|
|
"======================================================================
|
|
|
|
|
|
|
|
|
|
if has('vim_starting')
|
|
|
|
|
set nocompatible
|
|
|
|
|
set runtimepath+=~/.vim/bundle/neobundle.vim/
|
|
|
|
|
endif
|
|
|
|
|
|
2014-09-19 16:39:04 +00:00
|
|
|
|
call neobundle#begin(expand('~/.vim/bundle/'))
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
|
|
|
|
" Let NeoBundle manage NeoBundle
|
|
|
|
|
NeoBundleFetch 'Shougo/neobundle.vim'
|
|
|
|
|
|
|
|
|
|
|
2015-01-04 16:25:29 +00:00
|
|
|
|
" All bundles, syntaxes and plugins
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
NeoBundle 'Shougo/neocomplete'
|
2014-03-19 13:25:37 +00:00
|
|
|
|
NeoBundle 'Shougo/neosnippet'
|
2014-06-02 10:28:38 +00:00
|
|
|
|
NeoBundle 'Shougo/unite.vim'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'Shougo/vimproc.vim', {
|
|
|
|
|
\ 'build': {
|
|
|
|
|
\ 'mac': 'make -f make_mac.mak',
|
|
|
|
|
\ 'linux': 'make',
|
|
|
|
|
\ 'unix': 'gmake'
|
|
|
|
|
\ }
|
2014-09-18 16:02:27 +00:00
|
|
|
|
\ }
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'altercation/vim-colors-solarized'
|
|
|
|
|
NeoBundle 'beyondwords/vim-twig'
|
2014-09-24 13:01:38 +00:00
|
|
|
|
NeoBundle 'christoomey/vim-tmux-navigator'
|
2014-02-24 15:21:54 +00:00
|
|
|
|
NeoBundle 'editorconfig/editorconfig-vim'
|
2015-01-11 20:42:59 +00:00
|
|
|
|
NeoBundle 'ekalinin/Dockerfile.vim'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'elzr/vim-json'
|
2014-03-26 15:33:00 +00:00
|
|
|
|
NeoBundle 'gcmt/wildfire.vim'
|
2014-02-24 15:21:54 +00:00
|
|
|
|
NeoBundle 'godlygeek/tabular'
|
2014-10-30 16:37:58 +00:00
|
|
|
|
NeoBundle 'haya14busa/incsearch.vim'
|
2014-09-18 16:02:27 +00:00
|
|
|
|
NeoBundle 'itchyny/lightline.vim'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'joshtronic/php.vim'
|
2014-02-24 15:21:54 +00:00
|
|
|
|
NeoBundle 'justinmk/vim-sneak'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'mattn/emmet-vim'
|
|
|
|
|
NeoBundle 'moll/vim-node'
|
|
|
|
|
NeoBundle 'othree/html5.vim'
|
|
|
|
|
NeoBundle 'pangloss/vim-javascript'
|
2014-02-24 15:21:54 +00:00
|
|
|
|
NeoBundle 'scrooloose/syntastic'
|
|
|
|
|
NeoBundle 'tomtom/tcomment_vim'
|
|
|
|
|
NeoBundle 'tpope/vim-fugitive'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'tpope/vim-git'
|
2015-02-21 13:31:20 +00:00
|
|
|
|
NeoBundle 'tpope/vim-haml' " for sass as well
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'tpope/vim-markdown'
|
2014-02-24 15:21:54 +00:00
|
|
|
|
NeoBundle 'tpope/vim-ragtag'
|
|
|
|
|
NeoBundle 'tpope/vim-repeat'
|
|
|
|
|
NeoBundle 'tpope/vim-surround'
|
|
|
|
|
NeoBundle 'tpope/vim-unimpaired'
|
2014-09-18 16:02:27 +00:00
|
|
|
|
NeoBundle 'tpope/vim-vinegar'
|
2015-01-04 16:25:29 +00:00
|
|
|
|
NeoBundle 'vim-scripts/matchit.zip'
|
2014-03-19 13:25:37 +00:00
|
|
|
|
NeoBundle 'webgefrickel/vim-snippets'
|
2014-04-26 18:31:55 +00:00
|
|
|
|
NeoBundle 'wellle/tmux-complete.vim'
|
2014-03-11 12:51:18 +00:00
|
|
|
|
|
2014-09-19 16:39:04 +00:00
|
|
|
|
" end neobundle config
|
|
|
|
|
call neobundle#end()
|
|
|
|
|
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" Default sane config
|
|
|
|
|
"======================================================================
|
2013-05-12 17:39:10 +00:00
|
|
|
|
|
|
|
|
|
filetype plugin indent on
|
|
|
|
|
syntax on
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set autoread " Automatically read a file that has changed on disk
|
|
|
|
|
set backspace=indent,eol,start " Allow backspacing over everything in insert mode
|
2014-09-18 16:02:27 +00:00
|
|
|
|
set cursorline " highlight current line
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set encoding=utf-8 " Yeah. UTF-8 FTW!
|
|
|
|
|
set grepprg=ag " use ag for grepping
|
|
|
|
|
set hidden " allows for switching buffers without writing
|
|
|
|
|
set lazyredraw " Don't redraw while executing macros
|
|
|
|
|
set mouse=a " mouse for scrolling
|
|
|
|
|
set nobackup " no backups
|
|
|
|
|
set noerrorbells " don't beep
|
|
|
|
|
set noesckeys " no delay for escaping
|
2014-09-18 16:02:27 +00:00
|
|
|
|
set noshowmode " dont show active mode
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set noswapfile " no swp-files
|
|
|
|
|
set nowrap " dont wrap lines around
|
|
|
|
|
set nowritebackup " no stupid backup files
|
|
|
|
|
set pastetoggle=<F2> " toggle paste-mode for c&p with F2
|
|
|
|
|
set relativenumber " relative line numbers are mothereffin awesome -- see how far your commands will go
|
|
|
|
|
set ruler " show where you are in the document
|
|
|
|
|
set scrolljump=5 " Lines to scroll when cursor leaves screen
|
|
|
|
|
set scrolloff=3 " Minimum lines to keep above and below cursor
|
|
|
|
|
set showcmd " show me what im doing. helps alot
|
|
|
|
|
set sidescroll=10 " smoother side-scrolling
|
|
|
|
|
set sidescrolloff=5 " jump by 5 when scrolling sideways
|
2015-01-04 16:25:29 +00:00
|
|
|
|
set timeout ttimeoutlen=100 " get rid of the delay when pressing O (for example)
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set ttyfast " faster terminal usage
|
2014-08-14 15:08:33 +00:00
|
|
|
|
set ttymouse=xterm2 " xterm/tmux compatible mouse
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set virtualedit=all " every mode active from v V to StrgV
|
|
|
|
|
set visualbell " don't flicker
|
2015-01-11 20:42:59 +00:00
|
|
|
|
set complete-=i " dont complete from files
|
|
|
|
|
set nrformats-=octal " nobody uses octal anyway
|
|
|
|
|
set display+=lastline " shorten long lastlines
|
|
|
|
|
set formatoptions+=j " Delete comment character when joining commented lines
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" Searching, completion and folds
|
|
|
|
|
"======================================================================
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set ignorecase
|
|
|
|
|
set smartcase
|
|
|
|
|
set hlsearch
|
2014-10-30 16:37:58 +00:00
|
|
|
|
set showmatch
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set wrapscan
|
2014-01-21 21:26:44 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set wildmode=list:longest,list:full
|
|
|
|
|
set wildmenu
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set foldignore=
|
|
|
|
|
set foldmethod=indent " indent folding
|
|
|
|
|
set foldnestmax=20 " max 20 levels of folding
|
|
|
|
|
set nofoldenable " dont fold by default - let me do it
|
|
|
|
|
set foldlevelstart=1 " deactivate folding on fileload
|
2013-12-07 14:33:30 +00:00
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" Tabs and Whitespace -- can be overridden by editorconfig
|
|
|
|
|
"======================================================================
|
|
|
|
|
|
|
|
|
|
set fileformat=unix
|
2012-05-28 14:38:01 +00:00
|
|
|
|
set tabstop=2
|
|
|
|
|
set softtabstop=2
|
|
|
|
|
set shiftwidth=2
|
|
|
|
|
set shiftround
|
|
|
|
|
set smarttab
|
|
|
|
|
set expandtab
|
|
|
|
|
set autoindent
|
|
|
|
|
|
2014-01-15 18:35:18 +00:00
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
" gui options for macvim / gvim
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
|
|
|
|
|
2012-09-19 21:24:12 +00:00
|
|
|
|
if has('gui_running')
|
2014-09-02 09:11:50 +00:00
|
|
|
|
set guifont=Menlo\ for\ Powerline:h12 " a nice font here
|
2012-09-22 13:23:04 +00:00
|
|
|
|
set linespace=1 " menlo is nice, but very dense...
|
|
|
|
|
set guioptions-=T " no toolbar
|
|
|
|
|
set guioptions-=L " no left scrollbar
|
|
|
|
|
set guioptions-=r " no right scrollbar
|
|
|
|
|
endif
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
|
" mac terminal-vim play nicely with tmux
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
|
|
|
|
|
2012-09-22 13:23:04 +00:00
|
|
|
|
if &term =~ '^screen'
|
|
|
|
|
" tmux will send xterm-style keys when its xterm-keys option is on
|
|
|
|
|
execute "set <xUp>=\e[1;*A"
|
|
|
|
|
execute "set <xDown>=\e[1;*B"
|
|
|
|
|
execute "set <xRight>=\e[1;*C"
|
|
|
|
|
execute "set <xLeft>=\e[1;*D"
|
2012-09-19 21:24:12 +00:00
|
|
|
|
endif
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
|
|
|
|
" colorscheme and optical stuff
|
|
|
|
|
"======================================================================
|
|
|
|
|
|
|
|
|
|
" custom list/invisible chars
|
2015-01-04 16:25:29 +00:00
|
|
|
|
set list! " nice Whitespace chars
|
2014-02-24 15:21:54 +00:00
|
|
|
|
set listchars=extends:»,precedes:«,tab:▸\ ,trail:·
|
|
|
|
|
set fillchars=
|
|
|
|
|
|
|
|
|
|
set laststatus=2 " statusbar is 2 high
|
2015-01-04 16:25:29 +00:00
|
|
|
|
set cmdheight=2 " command window is 2 high
|
|
|
|
|
set cpoptions+=$ " Add a $ to the end of a selection
|
|
|
|
|
set cpoptions+=J " 2 spaces after a sentence for easier text manupulation
|
2013-05-14 17:32:05 +00:00
|
|
|
|
|
2014-09-19 16:26:48 +00:00
|
|
|
|
colorscheme solarized
|
|
|
|
|
let g:solarized_termtrans = 1
|
2014-07-16 13:02:27 +00:00
|
|
|
|
set background=dark " and a dark background of course
|
|
|
|
|
set t_Co=256 " 256 color terminal FTW
|
2014-09-19 16:26:48 +00:00
|
|
|
|
|
2014-09-24 11:08:43 +00:00
|
|
|
|
" minor optical fix vor syntastic - background for extra-error-column
|
2014-09-24 12:19:16 +00:00
|
|
|
|
highlight SignColumn ctermbg=0
|
2014-09-19 16:26:48 +00:00
|
|
|
|
|
|
|
|
|
" italic comments, yeah
|
|
|
|
|
highlight Comment cterm=italic
|
2013-05-12 17:39:10 +00:00
|
|
|
|
|
2014-09-24 11:08:43 +00:00
|
|
|
|
" bold concealed functions
|
|
|
|
|
highlight Conceal cterm=bold
|
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" Custom functions
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" for stripping trailing whitespace
|
|
|
|
|
function! <SID>StripTrailingWhitespaces()
|
|
|
|
|
let l = line(".")
|
|
|
|
|
let c = col(".")
|
|
|
|
|
%s/\s\+$//e
|
|
|
|
|
call cursor(l, c)
|
|
|
|
|
endfunction
|
2014-02-24 20:56:47 +00:00
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" autocommands, filetypes, spelling, keywords for specific filetypes
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
2015-01-04 16:25:29 +00:00
|
|
|
|
|
|
|
|
|
" define a group `vimrc` and initialize.
|
|
|
|
|
augroup vimrc
|
|
|
|
|
autocmd!
|
|
|
|
|
augroup END
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" Remember last location/cursor in file
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" spell correction on text-files
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.md setlocal spell
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" add the dash to keywords -- makes better css/js/html search
|
|
|
|
|
" do this for specific files only (not in php/rb e.g.)
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.{js,scss,html} set iskeyword+=-
|
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.{js,scss,html} set iskeyword-=_
|
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.php set iskeyword-=-
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2014-07-18 15:24:20 +00:00
|
|
|
|
" scss.css snippets and stuff
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.scss set filetype=scss.css
|
2014-07-18 15:24:20 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" Syntaxes for other files
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc BufNewFile,BufRead *.twig set filetype=html.twig
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
" omnicompletion for some filetypes
|
2015-01-04 16:25:29 +00:00
|
|
|
|
autocmd vimrc FileType css,scss setlocal omnifunc=csscomplete#CompleteCSS
|
|
|
|
|
autocmd vimrc FileType html,php,twig setlocal omnifunc=htmlcomplete#CompleteTags
|
|
|
|
|
autocmd vimrc FileType php setlocal omnifunc=phpcomplete#CompletePHP
|
|
|
|
|
autocmd vimrc FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
|
|
|
|
autocmd vimrc FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
2014-09-18 16:02:27 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2013-11-23 19:00:03 +00:00
|
|
|
|
" Custom key mappings and shortcuts
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
2014-02-22 23:47:08 +00:00
|
|
|
|
|
2015-01-04 16:25:29 +00:00
|
|
|
|
" remap semi-colon to be colon in normal an visual mode
|
2012-05-28 14:38:01 +00:00
|
|
|
|
nnoremap ; :
|
2013-12-31 13:54:47 +00:00
|
|
|
|
vnoremap ; :
|
2013-12-07 14:33:30 +00:00
|
|
|
|
|
|
|
|
|
" Swap v and CTRL-V, because Block mode is more useful
|
|
|
|
|
nnoremap v <C-V>
|
|
|
|
|
nnoremap <C-V> v
|
|
|
|
|
vnoremap v <C-V>
|
|
|
|
|
vnoremap <C-V> v
|
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
" jk nice behaviour (screen lines vs. shown lines)
|
|
|
|
|
nnoremap j gj
|
|
|
|
|
nnoremap k gk
|
|
|
|
|
|
2013-02-22 18:43:07 +00:00
|
|
|
|
" behave - yank just like D and C
|
|
|
|
|
nnoremap Y y$
|
|
|
|
|
|
2015-03-01 15:47:26 +00:00
|
|
|
|
" auto-yanking with clipper for selected yanking, see leader-y mapping
|
|
|
|
|
vnoremap y y :call system('nc localhost 8377', @0)<cr>
|
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
" Search mappings: These will make it so that going to the next one in a
|
|
|
|
|
" search will center on the line it's found in.
|
|
|
|
|
nnoremap N Nzz
|
|
|
|
|
nnoremap n nzz
|
|
|
|
|
|
2014-07-18 17:30:29 +00:00
|
|
|
|
" use the arrowkeys for usefull stuff in normal mode -- switching buffers
|
2013-05-12 19:31:07 +00:00
|
|
|
|
nnoremap <up> :bfirst<cr>
|
|
|
|
|
nnoremap <down> :blast<cr>
|
2012-05-28 14:38:01 +00:00
|
|
|
|
nnoremap <left> :bp<cr>
|
|
|
|
|
nnoremap <right> :bn<cr>
|
|
|
|
|
|
2014-01-14 13:39:40 +00:00
|
|
|
|
" Bubble/indent lines using unimpaired
|
2015-01-04 16:25:29 +00:00
|
|
|
|
" using left alt + hjkl on mac usgerman keyboard
|
2014-09-24 13:01:38 +00:00
|
|
|
|
nmap ˚ [e
|
|
|
|
|
nmap ∆ ]e
|
|
|
|
|
nmap ˙ <<
|
|
|
|
|
nmap ¬ >>
|
|
|
|
|
vmap ˚ [egv
|
|
|
|
|
vmap ∆ ]egv
|
|
|
|
|
vmap ˙ <gv
|
|
|
|
|
vmap ¬ >gv
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2015-01-04 16:25:29 +00:00
|
|
|
|
" Fast Switch between windows/buffers with tab
|
2014-02-24 15:21:54 +00:00
|
|
|
|
nnoremap <tab> <C-w><C-w>
|
|
|
|
|
nnoremap <S-tab> <C-w>W
|
2013-05-12 19:31:07 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" no help while mishitting ESC - awesome
|
2015-01-04 16:25:29 +00:00
|
|
|
|
noremap <F1> <ESC>
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2013-05-12 19:31:07 +00:00
|
|
|
|
" deactivate stupid ex-mode and man-page stuff
|
2012-08-06 21:07:34 +00:00
|
|
|
|
nnoremap Q <nop>
|
|
|
|
|
nnoremap K <nop>
|
|
|
|
|
|
2012-12-03 12:46:43 +00:00
|
|
|
|
" reload files when set autoread is active with F5
|
2014-06-30 11:55:11 +00:00
|
|
|
|
nnoremap <F5> :checktime<CR>
|
|
|
|
|
|
|
|
|
|
" Autoformat plugin
|
|
|
|
|
nnoremap <F3> :Autoformat<CR>
|
|
|
|
|
|
2014-01-21 21:26:44 +00:00
|
|
|
|
" For when you forget to sudo.. Really Write the file.
|
|
|
|
|
cmap w!! w !sudo tee % >/dev/null
|
|
|
|
|
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" take me to your leader!
|
|
|
|
|
"======================================================================
|
2013-11-23 19:00:03 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
let g:mapleader = ","
|
|
|
|
|
let g:maplocalleader = ","
|
2013-12-11 13:00:05 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" open new vertical split and change to split
|
|
|
|
|
nnoremap <leader>\ <C-w>v<C-w>l
|
|
|
|
|
nnoremap <leader>- <C-w>s<C-w>j
|
2013-12-11 13:00:05 +00:00
|
|
|
|
|
2014-09-24 13:01:38 +00:00
|
|
|
|
" Adjust viewports/splits to equal widths/heights
|
2014-02-24 15:21:54 +00:00
|
|
|
|
nnoremap <leader>= <C-w>=
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" open a new split and edit the vimrc // easy sourcing vimrc
|
|
|
|
|
nnoremap <leader>ve <C-w>v<C-w>l :e ~/.vimrc<cr>
|
|
|
|
|
nnoremap <leader>vs :source ~/.vimrc<cr>
|
2013-11-23 19:00:03 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" Opens an edit command with the path of the currently edited file filled in
|
|
|
|
|
nnoremap <leader>o :e <C-R>=expand("%:p:h") . "/" <CR>
|
2013-05-14 17:32:05 +00:00
|
|
|
|
|
2014-12-16 17:21:41 +00:00
|
|
|
|
" Yank to clipboard with clipper -- see https://github.com/wincent/clipper
|
|
|
|
|
nnoremap <leader>y :call system('nc localhost 8377', @0)<CR>
|
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" reset search
|
2015-01-04 16:25:29 +00:00
|
|
|
|
nnoremap <leader><space> :noh<cr>
|
2013-12-11 13:00:05 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" short command to strip trainling whitepsace
|
2015-01-04 16:25:29 +00:00
|
|
|
|
nnoremap <leader>w :call <SID>StripTrailingWhitespaces()<CR>
|
2013-05-12 19:31:07 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" Find merge conflict markers
|
2015-01-04 16:25:29 +00:00
|
|
|
|
nnoremap <leader>g /\v^[<\|=>]{7}( .*\|$)<CR>
|
2013-11-23 19:00:03 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
" paste keeping indentation
|
|
|
|
|
nnoremap <leader>p p`[v`]=
|
2012-06-20 17:15:15 +00:00
|
|
|
|
|
2013-07-16 21:54:40 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" Plugin configuration and keymappings
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
2013-07-16 21:54:40 +00:00
|
|
|
|
|
2014-10-30 16:37:58 +00:00
|
|
|
|
" incsearch
|
|
|
|
|
let g:incsearch#auto_nohlsearch = 1
|
|
|
|
|
let g:incsearch#consistent_n_direction = 1
|
|
|
|
|
let g:incsearch#magic = '\v'
|
|
|
|
|
map / <Plug>(incsearch-forward)
|
|
|
|
|
map ? <Plug>(incsearch-backward)
|
|
|
|
|
map g/ <Plug>(incsearch-stay)
|
|
|
|
|
map n <Plug>(incsearch-nohl-n)
|
|
|
|
|
map N <Plug>(incsearch-nohl-N)
|
|
|
|
|
map * <Plug>(incsearch-nohl-*)
|
|
|
|
|
map # <Plug>(incsearch-nohl-#)
|
|
|
|
|
map g* <Plug>(incsearch-nohl-g*)
|
|
|
|
|
map g# <Plug>(incsearch-nohl-g#)
|
2014-09-24 13:01:38 +00:00
|
|
|
|
|
2015-01-04 16:25:29 +00:00
|
|
|
|
|
|
|
|
|
" emmet
|
|
|
|
|
let g:user_emmet_install_global = 0
|
|
|
|
|
autocmd vimrc FileType html,css,scss,php EmmetInstall
|
|
|
|
|
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" vim sneak
|
|
|
|
|
let g:sneak#use_ic_scs = 1
|
|
|
|
|
let g:sneak#map_netrw = 0
|
|
|
|
|
let g:sneak#streak = 1
|
|
|
|
|
nmap <Bslash> <Plug>SneakNext
|
|
|
|
|
nmap \| <Plug>SneakPrevious
|
|
|
|
|
xmap <Bslash> <Plug>VSneakNext
|
|
|
|
|
xmap \| <Plug>VSneakPrevious
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" fugitive
|
2014-02-24 15:21:54 +00:00
|
|
|
|
nnoremap <silent> <leader>gs :Gstatus<CR><C-w>20+
|
|
|
|
|
nnoremap <silent> <leader>gd :Gdiff<CR><C-w>20+
|
|
|
|
|
nnoremap <silent> <leader>gc :Gcommit<CR><C-w>20+
|
|
|
|
|
nnoremap <silent> <leader>gw :Gwrite<CR><C-w>20+
|
2013-07-16 21:54:40 +00:00
|
|
|
|
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
|
|
|
|
" Tabularize
|
|
|
|
|
vmap <Leader>t= :Tabularize /=<CR>
|
|
|
|
|
vmap <Leader>t{ :Tabularize /{<CR>
|
|
|
|
|
vmap <Leader>t: :Tabularize /:<CR>
|
|
|
|
|
vmap <Leader>t, :Tabularize /,<CR>
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
|
|
|
|
|
" TComment
|
|
|
|
|
nnoremap <leader>/ :TComment<CR>
|
|
|
|
|
vnoremap <leader>/ :TComment<CR>
|
|
|
|
|
inoremap <leader>/ <Esc>:TComment<CR>
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" neosnippet
|
2014-06-24 12:59:40 +00:00
|
|
|
|
let g:neosnippet#disable_runtime_snippets = { "_": 1 }
|
2014-03-19 15:06:17 +00:00
|
|
|
|
let g:neosnippet#scope_aliases = {}
|
2014-10-30 16:08:56 +00:00
|
|
|
|
let g:neosnippet#scope_aliases['scss'] = 'scss,css'
|
2014-10-28 18:06:50 +00:00
|
|
|
|
let g:neosnippet#scope_aliases['php'] = 'php,html'
|
2014-09-18 16:02:27 +00:00
|
|
|
|
let g:neosnippet#snippets_directory = '~/.vim/bundle/vim-snippets/snippets'
|
2014-09-18 11:31:02 +00:00
|
|
|
|
|
2015-03-01 21:17:01 +00:00
|
|
|
|
|
2014-09-18 11:31:02 +00:00
|
|
|
|
" Neosnippet - SuperTab like snippets behavior.
|
|
|
|
|
smap <C-k> <Plug>(neosnippet_expand_or_jump)
|
2014-03-19 15:06:17 +00:00
|
|
|
|
imap <C-k> <Plug>(neosnippet_expand_or_jump)
|
|
|
|
|
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
|
2014-06-30 11:55:11 +00:00
|
|
|
|
\ "\<Plug>(neosnippet_expand_or_jump)"
|
|
|
|
|
\: pumvisible() ? "\<C-n>" : "\<TAB>"
|
2014-09-18 11:31:02 +00:00
|
|
|
|
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
|
|
|
|
|
\ "\<Plug>(neosnippet_expand_or_jump)"
|
|
|
|
|
\: "\<TAB>"
|
2014-02-22 23:47:08 +00:00
|
|
|
|
|
2012-05-28 14:38:01 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" Syntastic
|
|
|
|
|
" no checking for xhtml/html -- because of fluidtemplate for TYPO3
|
|
|
|
|
" and no checking for scss.css because of CSS3 and SASS-Variable
|
|
|
|
|
let g:syntastic_auto_jump = 0
|
2015-03-09 15:55:30 +00:00
|
|
|
|
let g:syntastic_scss_scss_lint_exec = '/Users/webgefrickel/.rbenv/shims/scss-lint'
|
|
|
|
|
let g:syntastic_scss_checkers = ['scss_lint']
|
2014-11-24 13:49:10 +00:00
|
|
|
|
let g:syntastic_javascript_checkers = ['eslint']
|
2014-08-14 15:08:33 +00:00
|
|
|
|
let g:syntastic_json_checkers = ['jsonlint']
|
2014-03-19 15:06:17 +00:00
|
|
|
|
let g:syntastic_mode_map = {
|
2014-09-18 16:02:27 +00:00
|
|
|
|
\ 'mode': 'active',
|
2015-03-09 15:55:30 +00:00
|
|
|
|
\ 'active_filetypes': ['php', 'scss', 'javascript', 'json'],
|
|
|
|
|
\ 'passive_filetypes': ['xhtml', 'html']
|
2014-09-18 16:02:27 +00:00
|
|
|
|
\ }
|
2014-09-04 18:39:39 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
" wildfire -- selecting with enter/backspace
|
2015-01-04 16:25:29 +00:00
|
|
|
|
let g:wildfire_objects = ['iw', 'iW', 'i"', "i\'", 'i)', 'i]', 'i}', 'i>', 'ip', 'it']
|
2014-03-26 15:33:00 +00:00
|
|
|
|
let g:wildfire_fuel_map = "<ENTER>"
|
|
|
|
|
let g:wildfire_water_map = "<BS>"
|
|
|
|
|
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
" NEOCOMPLETE
|
|
|
|
|
let g:acp_enableAtStartup = 0
|
|
|
|
|
let g:neocomplete#enable_at_startup = 1
|
2014-09-04 18:39:39 +00:00
|
|
|
|
let g:neocomplete#auto_completion_start_length = 3
|
2014-11-19 19:32:07 +00:00
|
|
|
|
let g:neocomplete#force_overwrite_completefunc = 1
|
2014-03-26 15:33:00 +00:00
|
|
|
|
inoremap <expr><C-g> neocomplete#undo_completion()
|
|
|
|
|
inoremap <expr><C-l> neocomplete#complete_common_string()
|
2014-09-18 16:02:27 +00:00
|
|
|
|
inoremap <silent> <CR> <C-r>=<SID>neocomplete_cr_function()<CR>
|
2014-03-19 15:06:17 +00:00
|
|
|
|
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
|
|
|
|
|
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
|
|
|
|
|
inoremap <expr><C-y> neocomplete#close_popup()
|
|
|
|
|
inoremap <expr><C-e> neocomplete#cancel_popup()
|
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
function! s:neocomplete_cr_function()
|
2014-03-26 15:33:00 +00:00
|
|
|
|
return neocomplete#close_popup() . "\<CR>"
|
|
|
|
|
endfunction
|
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
if !exists('g:neocomplete#sources#omni#input_patterns')
|
|
|
|
|
let g:neocomplete#sources#omni#input_patterns = {}
|
2014-09-04 18:39:39 +00:00
|
|
|
|
let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
|
2014-03-19 15:06:17 +00:00
|
|
|
|
endif
|
2014-09-04 18:39:39 +00:00
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
|
|
|
|
|
" The Lightline Plugin
|
|
|
|
|
"======================================================================
|
|
|
|
|
|
|
|
|
|
let g:lightline = {
|
2014-09-19 15:47:23 +00:00
|
|
|
|
\ 'colorscheme': 'solarized_dark',
|
2014-09-18 16:02:27 +00:00
|
|
|
|
\ 'active': {
|
|
|
|
|
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ],
|
|
|
|
|
\ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
|
|
|
\ },
|
|
|
|
|
\ 'component_function': {
|
|
|
|
|
\ 'modified': 'LightlineModified',
|
|
|
|
|
\ 'readonly': 'LightlineReadonly',
|
|
|
|
|
\ 'fugitive': 'LightlineFugitive',
|
|
|
|
|
\ 'filename': 'LightlineFilename',
|
|
|
|
|
\ 'fileformat': 'LightlineFileformat',
|
|
|
|
|
\ 'filetype': 'LightlineFiletype',
|
|
|
|
|
\ 'fileencoding': 'LightlineFileencoding',
|
|
|
|
|
\ 'mode': 'LightlineMode',
|
|
|
|
|
\ },
|
|
|
|
|
\ 'separator': { 'left': '⮀', 'right': '⮂' },
|
|
|
|
|
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
|
|
|
|
|
\ }
|
|
|
|
|
|
|
|
|
|
function! LightlineModified()
|
|
|
|
|
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineReadonly()
|
|
|
|
|
return &ft !~? 'help' && &readonly ? '⭤' : ''
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineFilename()
|
|
|
|
|
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
|
|
|
|
|
\ (&ft == 'unite' ? unite#get_status_string() :
|
|
|
|
|
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
|
|
|
|
|
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineFugitive()
|
|
|
|
|
if exists("*fugitive#head")
|
|
|
|
|
let _ = fugitive#head()
|
|
|
|
|
return strlen(_) ? '⭠ '._ : ''
|
|
|
|
|
endif
|
|
|
|
|
return ''
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineFileformat()
|
|
|
|
|
return winwidth(0) > 70 ? &fileformat : ''
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineFiletype()
|
|
|
|
|
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineFileencoding()
|
|
|
|
|
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
function! LightlineMode()
|
|
|
|
|
let fname = expand('%:t')
|
|
|
|
|
return &ft == 'unite' ? 'Unite' : winwidth(0) > 60 ? lightline#mode() : ''
|
|
|
|
|
endfunction
|
2014-09-04 18:39:39 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
|
2014-09-18 16:02:27 +00:00
|
|
|
|
" The Unite Plugin
|
2014-02-24 15:21:54 +00:00
|
|
|
|
"======================================================================
|
2013-11-23 15:54:42 +00:00
|
|
|
|
|
2014-07-07 12:23:06 +00:00
|
|
|
|
let g:unite_prompt='❯ '
|
2014-06-30 11:36:26 +00:00
|
|
|
|
let g:unite_source_grep_command='ag'
|
2014-07-07 12:23:06 +00:00
|
|
|
|
let g:unite_source_grep_default_opts='--nocolor --nogroup -S'
|
2014-06-30 11:36:26 +00:00
|
|
|
|
let g:unite_source_grep_recursive_opt=''
|
|
|
|
|
let g:unite_split_rule = "botright"
|
2014-09-18 16:02:27 +00:00
|
|
|
|
let g:unite_force_overwrite_statusline = 0
|
2014-06-30 11:36:26 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
call unite#filters#matcher_default#use(['matcher_fuzzy'])
|
|
|
|
|
call unite#filters#sorter_default#use(['sorter_rank'])
|
2014-09-18 16:02:27 +00:00
|
|
|
|
call unite#set_profile('files', 'context.smartcase', 1)
|
2014-03-19 15:06:17 +00:00
|
|
|
|
call unite#custom#source('line,outline', 'matchers', 'matcher_fuzzy')
|
2014-06-06 15:30:13 +00:00
|
|
|
|
call unite#custom_source('file_rec, file_rec/async, file_mru, file, buffer, grep',
|
2014-06-30 11:55:11 +00:00
|
|
|
|
\ 'ignore_pattern', join([
|
|
|
|
|
\ '\.git',
|
2014-09-01 18:31:03 +00:00
|
|
|
|
\ '\.svn',
|
2014-08-14 15:08:33 +00:00
|
|
|
|
\ '\.sass-cache',
|
2014-06-30 11:55:11 +00:00
|
|
|
|
\ '_srcs',
|
|
|
|
|
\ 'node_modules',
|
2014-08-14 15:08:33 +00:00
|
|
|
|
\ 'bower_components',
|
2014-09-01 18:31:03 +00:00
|
|
|
|
\ 'vim\/bundle',
|
2015-02-21 13:24:00 +00:00
|
|
|
|
\ '\.\(png\|gif\|jpg\|pdf\|ico\|mp4\|webm\|mp3\|woff\|ttf\|eot\|min\.js\|min\.map\|css\)$',
|
2014-06-30 11:55:11 +00:00
|
|
|
|
\ ], '\|'))
|
2013-11-23 15:54:42 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
nmap <space> [unite]
|
|
|
|
|
nnoremap [unite] <nop>
|
2014-02-24 15:21:54 +00:00
|
|
|
|
|
2014-09-01 18:31:03 +00:00
|
|
|
|
nnoremap <silent> [unite], :<C-u>Unite -start-insert -toggle -auto-resize file_rec/async<cr>
|
2014-05-15 08:29:17 +00:00
|
|
|
|
nnoremap <silent> [unite]b :<C-u>Unite -short-source-names -quick-match buffer<cr>
|
2014-09-01 18:31:03 +00:00
|
|
|
|
nnoremap <silent> [unite]. :<C-u>Unite -start-insert -auto-resize buffer<cr>
|
2014-11-19 11:08:43 +00:00
|
|
|
|
nnoremap <silent> [unite]l :<C-u>Unite -start-insert -auto-resize line<cr>
|
2014-09-01 18:31:03 +00:00
|
|
|
|
nnoremap <silent> [unite]y :<C-u>Unite history/yank<cr>
|
|
|
|
|
nnoremap <silent> [unite]f :<C-u>UniteWithCursorWord -start-insert -toggle -auto-resize file_rec/async<cr>
|
|
|
|
|
nnoremap <silent> [unite]a :<C-u>Unite grep:.<cr>
|
|
|
|
|
nnoremap <silent> [unite]A :<C-u>UniteWithCursorWord grep:.<cr>
|
2013-11-23 15:54:42 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
autocmd FileType unite call s:unite_settings()
|
2013-05-11 20:26:43 +00:00
|
|
|
|
|
2014-03-19 15:06:17 +00:00
|
|
|
|
function! s:unite_settings()
|
|
|
|
|
nmap <buffer> <ESC> <Plug>(unite_exit)
|
|
|
|
|
imap <buffer> <C-j> <Plug>(unite_select_next_line)
|
|
|
|
|
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
|
|
|
|
|
nmap <buffer> <C-r> <Plug>(unite_redraw)
|
|
|
|
|
imap <buffer> <C-r> <Plug>(unite_redraw)
|
|
|
|
|
inoremap <silent><buffer><expr> <C--> unite#do_action('split')
|
|
|
|
|
nnoremap <silent><buffer><expr> <C--> unite#do_action('split')
|
|
|
|
|
inoremap <silent><buffer><expr> <C-\> unite#do_action('vsplit')
|
|
|
|
|
nnoremap <silent><buffer><expr> <C-\> unite#do_action('vsplit')
|
|
|
|
|
endfunction
|