Last active
June 5, 2018 03:33
-
-
Save kirykr/b51dffa538aac551938cbb3c51908f71 to your computer and use it in GitHub Desktop.
vim configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
set nocompatible " be iMproved, required | |
"------------------YouCompleteMe Config--------------" | |
let g:ycm_path_to_python_interpreter = '/usr/bin/python' | |
"let g:ycm_filetype_specific_completion_to_disable = { 'python' : 1 } | |
"let g:ycm_filetype_blacklist = { 'python' : 1 } | |
let g:ycm_min_num_of_chars_for_completion = 2 | |
"let g:ycm_min_num_identifier_candidate_chars = 0 | |
let g:ycm_auto_trigger = 1 | |
let g:ycm_seed_identifiers_with_syntax = 1 | |
let g:ycm_semantic_triggers = { | |
\ 'c' : ['->', '.'], | |
\ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s', | |
\ 're!\[.*\]\s'], | |
\ 'ocaml' : ['.', '#'], | |
\ 'cpp,objcpp' : ['->', '.', '::'], | |
\ 'perl' : ['->'], | |
\ 'php' : ['->', '::'], | |
\ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'], | |
\ 'ruby' : ['.', '::'], | |
\ 'lua' : ['.', ':'], | |
\ 'erlang' : [':'], | |
\ } | |
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 | |
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 | |
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 | |
" ----- Plugins ---------" | |
so ~/.vim/plugins.vim | |
syntax enable | |
set conceallevel=1 | |
set path+=** | |
" ----------------Emmet----------------" | |
set encoding=utf-8 | |
let g:Powerline_symbols = 'fancy' | |
set fillchars+=stl:\ ,stlnc:\ | |
" ----------------Emmet----------------" | |
" let g:user_emmet_mode='n' "only enable normal mode functions. | |
let g:user_emmet_mode='inv' "enable all functions, which is equal to | |
" let g:user_emmet_mode='a' "enable all function in all mode. | |
"let g:user_emmet_install_global = 0 | |
autocmd FileType html,css EmmetInstall | |
"imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>") | |
"-----------------Vim JavaScript-------------" | |
let g:javascript_plugin_jsdoc = 1 | |
let g:javascript_plugin_ngdoc = 1 | |
let g:javascript_plugin_flow = 1 | |
"set foldmethod=syntax | |
let g:javascript_conceal_function = "ƒ" | |
let g:javascript_conceal_null = "ø" | |
let g:javascript_conceal_this = "@" | |
let g:javascript_conceal_return = "⇚" | |
let g:javascript_conceal_undefined = "¿" | |
let g:javascript_conceal_NaN = "ℕ" | |
let g:javascript_conceal_prototype = "¶" | |
let g:javascript_conceal_static = "•" | |
let g:javascript_conceal_super = "Ω" | |
let g:javascript_conceal_arrow_function = "⇒" | |
"------------------delimitMate----------------" | |
"let delimitMate_expand_cr = 1 | |
"-----------------color Intdentation-----------------" | |
"let g:indentLine_setColors = 0 | |
let g:indentLine_color_term = 239 | |
"let g:indentLine_char = "\UE000" | |
let g:indentLine_char = ":" | |
let g:indentLine_concealcursor = 'inc' | |
let g:indentLine_conceallevel = 2 | |
let g:indentLine_color_tty_light = 4 " (default: 4) | |
let g:indentLine_color_dark = 2 " (default: 2) | |
let mapleader = '\' "The default leader is \, but we set it with a comma | |
set number "Activated Line Numbers | |
set backspace=indent,eol,start | |
set tabstop=4 softtabstop=0 expandtab shiftwidth=2 smarttab | |
set list | |
set listchars=tab:>-,trail:· | |
"--------------Appearance---------" | |
"if has('gui_running') | |
" set background=light | |
"else | |
" set background=dark | |
"endif | |
set background=dark | |
colorscheme solarized | |
"colorscheme atom-dark | |
"set t_CO=256 | |
set guifont=Operator_Mono_Book:h15 | |
"set linespace=7 "Set-up line spacing | |
set guioptions-=l "disabled scroll bar letf | |
set guioptions-=L | |
"-------------------searching highlight----" | |
set hlsearch | |
set incsearch | |
"-------------------Mapping----------------" | |
nmap <leader>ev :tabedit ~/.vimrc | |
"Add simple highlight removal. ,space | |
nmap <leader><space> :nohlsearch<cr> | |
"Make NERDTree Ctrl + kb to toggle | |
nmap <C-k><C-b> :NERDTreeToggle<cr> | |
" Refresh NERDTree pane | |
nmap <leader>nr :NERDTreeFocus<cr> \| R \| <c-w><c-p> | |
"------------------Syntax Highlight-------" | |
highlight ExtraWhitespace ctermbg=red guibg=red | |
match ExtraWhitespace /\s\+$/ | |
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ | |
autocmd BufWinLeave * call clearmatches() | |
"-----------------removed trailing space on save---------------" | |
autocmd BufWritePre * :call <SID>StripWhite() | |
fun! <SID>StripWhite() | |
%s/[ \t]\+$//ge | |
%s!^\( \+\)\t!\=StrRepeat("\t", 1 + strlen(submatch(1)) / 8)!ge | |
endfun | |
"------------------Auto source-------------" | |
"Make it easy to edit the vimrc file. | |
augroup autosourcing | |
autocmd! | |
autocmd BufWritePost .vimrc source % | |
autocmd BufWritePre * :call <SID>StripWhite() | |
augroup END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
// brew install cmake | |
// got .vim/bundle/YouCompleteMe run ./install.py --all | |
// you might need to add the environment path for go-language see this https://stackoverflow.com/a/27709931 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'vim-ruby/vim-ruby' | |
Plugin 'tpope/vim-rails' | |
Plugin 'mattn/emmet-vim' | |
Plugin 'raimondi/delimitmate' | |
Plugin 'tpope/vim-endwise' | |
Plugin 'yggdroot/indentline' | |
Plugin 'pangloss/vim-javascript' | |
Plugin 'nsf/gocode', {'rtp': 'vim/'} | |
Plugin 'fatih/vim-go' | |
Plugin 'Lokaltog/vim-powerline' | |
" All of your Plugins must be added before the following line | |
call vundle#end() " required | |
filetype plugin indent on " required |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment