Skip to content

Instantly share code, notes, and snippets.

@cybaj
Created October 7, 2019 06:01
Show Gist options
  • Save cybaj/dcd272353d86d9d026a6a224caa5c23b to your computer and use it in GitHub Desktop.
Save cybaj/dcd272353d86d9d026a6a224caa5c23b to your computer and use it in GitHub Desktop.
.vimrc
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'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'posva/vim-vue'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'crusoexia/vim-monokai'
Plugin 'nanotech/jellybeans.vim'
Plugin 'morhetz/gruvbox'
Plugin 'leafgarland/typescript-vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'SirVer/ultisnips'
Plugin 'Raimondi/delimitMate'
" 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
"" ycm setting
let g:ycm_key_list_select_completion = ['<C-n>']
let g:ycm_key_list_previous_completion=['<C-p>']
let g:ycm_server_python_interpreter = '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3'
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_complete_in_strings = 1
let g:ycm_complete_in_comments = 1
let g:ycm_min_num_of_chars_for_completion = 1
let g:ycm_filetype_blacklist = {}
let g:ycm_use_ultisnips_completer = 1
let mapleader=","
map <leader>d <ESC><ESC>:YcmDiags<CR>
map <leader>f <ESC><ESC>:YcmCompleter GoToDeclaration<CR>
map <leader>g <ESC><ESC>:YcmCompleter GoToDefinition<CR>
map <leader>o <ESC><ESC>:YcmCompleter GetDoc<CR>
map <leader>t <ESC><ESC>:YcmCompleter GetType<CR>
"" syntastic setting
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"" ctrlp.vim setting
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] "Ignore in .gitignore
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git' "Ignore node_modules
let g:ctrlp_custom_ignore = {
\ 'file': '\v\.(pyc|so|dll)$',
\ }
"" vim-airline setting
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1 " buffer number를 보여준다
let g:airline#extensions#tabline#buffer_nr_format = '%s:' " buffer number format
"" UtliSnips setting
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsEditSplit="vertical"
"" let g:UltiSnipsSnippetDirectories = ['~/.vim/UltiSnips']
"" 아래와 같이 해야 경로가 잡힌다.
let g:UltiSnipsSnippetDirectories = ['UltiSnips']
"" delimitMate
let delimitMate_expand_cr=1
"" colorscheme
colorscheme gruvbox
" colorscheme jellybeans
" colorscheme monokai
" let g:monokai_term_italic = 1
" let g:monokai_gui_italic = 1
"""" MAP
let mapleader=","
map <leader>e <ESC><ESC>:NERDTree<CR>
" relativenumber <=> number
map <leader>r <ESC>:set nu! relativenumber!<CR>
map <leader>E <ESC><ESC>:Explor<CR>
"buffer
map <leader>m <ESC><ESC>:bnext<CR>
"""" BASIC SETTING
set number
set smartindent
set autoindent
set tabstop=4
set shiftwidth=4
set backspace=eol,start,indent
set expandtab
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
autocmd FileType vue setlocal shiftwidth=2 tabstop=2
autocmd FileType html setlocal shiftwidth=2 tabstop=2
autocmd FileType python setlocal expandtab shiftwidth=4 softtabstop=4
autocmd FileType c setlocal expandtab shiftwidth=4 softtabstop=4
let g:netrw_keepdir=0
if has("syntax")
syntax on
endif
"""" abbr
iabbr __my_email cybaj@naver.com
iabbr __my_id cybaj
iabbr __my_name 김민석
iabbr js_cmt /* */<Esc>hhi
iabbr py_cmt /* */<Esc>hhi
iabbr html_cmt <!-- --><Esc>hhhi
iabbr js_log console.log()<Esc>i
iabbr py_log print()<Esc>i
iabbr <expr> __time strftime("%Y-%m-%d %H:%M:%S")
iabbr <expr> __filepath expand('%:p')
iabbr <expr> __filename expand('%')
iabbr <expr> __pwd expand('%:p:h')
iabbr <expr> __datetime system("faker -l ko_KR date_time")
iabbr <expr> __name system("faker -l ko_KR name")
iabbr <expr> __address system("faker -l ko_KR address")
iabbr <expr> __profile system("faker -l ko_KR profile address,birthdate,mail,name,username")
iabbr <expr> __profile_detail system("faker -l ko_KR profile")
iabbr <expr> __phone system("faker -l ko_KR phone_number")
iabbr <expr> __text system("kipsum 1 long")
iabbr <expr> __paragraph system("kipsum 1 medium")
iabbr <expr> __sentence system("kipsum 1 short")
iabbr <expr> __enname system("faker -l en_US name")
iabbr <expr> __enaddress system("faker -l en_US address")
iabbr <expr> __enprofile system("faker -l en_US profile address,birthdate,mail,name,username")
iabbr <expr> __enprofile_detail system("faker -l en_US profile")
iabbr <expr> __enphone system("faker -l en_US phone_number")
iabbr <expr> __entext system("faker -l en_US text")
iabbr <expr> __enparagraph system("faker -l en_US paragraph")
iabbr <expr> __ensentence system("faker -l en_US sentence")
iabbr <expr> __enword system("faker -l en_US word")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment