Skip to content

Instantly share code, notes, and snippets.

@generall
Last active February 6, 2016 20:56
Show Gist options
  • Save generall/2f1009425f216df76273 to your computer and use it in GitHub Desktop.
Save generall/2f1009425f216df76273 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"sudo apt-get install exuberant-ctags
Plugin 'majutsushi/tagbar'
Plugin 'xolox/vim-misc'
" Plugin 'xolox/vim-easytags'
Plugin 'scrooloose/nerdtree'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'vimwiki/vimwiki'
Plugin 'rdnetto/YCM-Generator'
Plugin 'Shougo/unite.vim'
Plugin 'Lokaltog/vim-powerline'
Plugin 'ngmy/vim-rubocop'
" Plugin 'vim-airline/vim-airline'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
Plugin 'https://github.com/Valloric/YouCompleteMe'
"Plugin 'jonathanfilip/vim-lucius'
Plugin 'powerman/vim-plugin-ruscmd'
Plugin 'Yggdroot/indentLine'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
set showcmd
set wildmenu
set wildmode=longest:full,full
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=700
" Enable filetype plugins
filetype plugin on
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
"Always show current position
set ruler
" Height of the command bar
set cmdheight=2
" Show matching brackets when text indicator is over them
set showmatch
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax on
set t_Co=256
try
set background=dark
let s:mycolors = ['hybrid', 'gruvbox', 'jellybeans', 'BusyBee', 'lucius']
let current = localtime() % len(s:mycolors)
execute 'colorscheme '.s:mycolors[current]
" colorscheme hybrid
" colorscheme gruvbox
" colorscheme jellybeans
" colorscheme BusyBee
" colorscheme lucius
" LuciusDark
catch
endtry
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Be smart when using tabs ;)
set smarttab
" 1 tab == 4 spaces
set shiftwidth=2
set tabstop=2
set expandtab
function TabsIndent()
set shiftwidth=4
set tabstop=4
set noexpandtab
endfunction
function SpacesIndent()
set shiftwidth=2
set tabstop=2
set expandtab
endfunction
filetype plugin indent on
command TabsIndent :call TabsIndent()
command SpacesIndent :call SpacesIndent()
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set nu
set splitbelow
set splitright
nnoremap <C-S-j> :m .+1<CR>==
nnoremap <C-S-k> :m .-2<CR>==
inoremap <C-S-j> <Esc>:m .+1<CR>==gi
inoremap <C-S-k> <Esc>:m .-2<CR>==gi
vnoremap <C-S-j> :m '>+1<CR>gv=gv
vnoremap <C-S-k> :m '<-2<CR>gv=gv
nmap <F8> :TagbarToggle<CR>
nmap <F7> :NERDTreeToggle<CR>
nnoremap <leader>f :<C-u>UniteWithBufferDir -start-insert file<CR>
nnoremap <leader>cf :<C-u>Unite -start-insert file<CR>
nnoremap <leader>b :<C-u>Unite -start-insert buffer<CR>
call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <leader>r :<C-u>Unite -start-insert file_rec/async:!<CR>
nnoremap <leader>df :w !diff -u % -
" vimwiki remappings
nmap <leader>gv <Plug>VimwikiVSplitLink
let g:vimwiki_list = [{'template_path': '~/vimwiki/templates/', 'template_default': 'default', 'template_ext': '.html'}]
let g:indentLine_enabled = 0
let g:indentLine_leadingSpaceChar = '·'
let g:indentLine_char = '┆'
function ToggleViewSpaces()
LeadingSpaceToggle
IndentLinesToggle
endfunction
nmap <F3> :call ToggleViewSpaces()<CR>
:inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" prevent folding on default
set foldlevelstart=99
set fdm=indent
set winaltkeys=no
set hlsearch
inoremap <M-h> <Esc>h
inoremap <M-j> <Esc>j
inoremap <M-k> <Esc>k
inoremap <M-l> <Esc>l
inoremap <M-b> <Esc>b
inoremap <M-w> <Esc>w
inoremap <M-e> <Esc>e
inoremap <M-v> <Esc>v
inoremap <M-p> <Esc>p
au CursorHoldI * stopinsert
" set 'updatetime' to 15 seconds when in insert mode
au InsertEnter * let updaterestore=&updatetime | set updatetime=15000
au InsertLeave * let &updatetime=updaterestore
set incsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment