" Plugins
call plug#begin('~/.vim/plugged')
Plug 'dracula/vim'
Plug 'junegunn/rainbow_parentheses.vim'
Plug 'preservim/nerdtree'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'blueyed/vim-diminactive'
Plug 'airblade/vim-gitgutter'
Plug 'ryanoasis/vim-devicons'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'mg979/vim-visual-multi'
Plug 'triglav/vim-visual-increment'
Plug 'christoomey/vim-tmux-navigator'
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'puremourning/vimspector'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
Plug 'rust-lang/rust.vim'
Plug 'tweekmonster/gofmt.vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'akinsho/toggleterm.nvim', {'tag' : '*'}
call plug#end()
" ToggleTerm
lua require("toggleterm").setup()
" Syntax Highlighting
if has ("syntax")
syntax on
endif
" Color Theme
if has('termguicolors')
set termguicolors
endif
colorscheme dracula
" Settings on AutoComplete
set autoindent
set hidden
set nobackup
set nowritebackup
set cmdheight=2
set updatetime=300
set shortmess+=c
"Settings on Tab
"set list lcs=tab:\|\
set expandtab
set tabstop=4
set shiftwidth=4
" Setting on Synchronization Vim Clipboard with OS Clipboard
set clipboard=unnamedplus
" Settings on General
set nu
set showmatch
set ruler
set cursorline
set ignorecase
set hlsearch
set incsearch
set mouse=a
set cc=80
" Setting on Nvim Feature
set ttyfast
set nocompatible
" Pane
set splitright
set splitbelow
" rainbow_parentheses.vim 설정
hi MatchParen cterm=none ctermbg=green ctermfg=blue
" nerdtree 설정
let NERDTreeShowHidden=1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
" vim-devicons 설정
set encoding=UTF-8
" vim-airline 설정
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_theme='wombat'
" vim-tmux-navigator 설정
let g:tmux_navigator_no_mappings = 0
" vim-diminactive 설정
let g:diminactive_use_syntax = 0
" AuCmd
au vimEnter * RainbowParentheses
au vimEnter * NERDTree | wincmd p
au bufEnter * if (winnr("$") == 1 && exists ("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" vimspector 설정
let g:vimspector_enable_mappings = 'HUMAN'
" Go Setting
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
let g:go_template_autocreate = 0
let g:gofmt_exe = 'gofmt'
let g:go_fmt_command = 'goimports'
" Mapping for Keys
inoremap jj <esc>
inoremap <C-h> <C-o>h
inoremap <C-j> <C-o>j
inoremap <C-k> <C-o>k
inoremap <C-l> <C-o>l
nnoremap q <Nop>
nnoremap x "_x
vnoremap d "_d
"nnoremap d "_d
"nnoremap D "_D
nnoremap jj <esc>I<tab><esc>
nnoremap kk <esc>I<esc>x
nnoremap ll <esc>I// <esc><C-j>I<esc>
nnoremap ;; <esc>I<esc>xxI<tab><esc>
nnoremap '' <esc><C-w>w
nnoremap <Leader>q <esc>:q!<cr>
nnoremap <Leader>w <esc>:w!<cr>
nnoremap <Leader>' <esc>a"<esc>I"<esc>A<esc>
nnoremap <tab><Left> <esc>I<esc>
nnoremap <tab><Right> <esc>A<esc>
" Mapping for Panes
nmap <silent> ge <Plug>(coc-definition)
nmap <silent> gs :sp<cr><Plug>(coc-definition)
nmap <silent> gv :vsp<cr><Plug>(coc-definition)
nmap <Leader>r ''r''
" Mapping for Pane Buffers
nnoremap <Leader>bl <esc>:ls<cr>
nnoremap <Leader>bd <esc>:b#<bar>bd#<cr>
nnoremap <S-tab> <esc>:bp<cr>
" Mapping for Plugins
nnoremap <Leader>i <esc>:w<cr>:so %<cr>:PlugInstall<cr>
nnoremap <Leader>p <esc>:RainbowParentheses<cr>
nnoremap <Leader>n <esc>:NERDTreeToggle<cr>
nnoremap mdb <esc>:MarkdownPreview<cr>
nnoremap mde <esc>:MarkdownPreviewStop<cr>
" Mapping for Commands
nnoremap cpl <esc>:!cpplint ./%<cr>
nnoremap gol <esc>:!golangci-lint run && gofmt -l<cr>
nnoremap rul <esc>:%! rustfmt<cr>
" Mapping for Debuggers
nnoremap <Leader>dd :call vimspector#Launch()<cr>
nnoremap <Leader>df :call vimspector#Reset()<cr>
nnoremap <Leader>dr :call vimspector#Continue()<cr>
nnoremap <Leader>dl :call vimspector#ListBreakpoints()<cr>
nnoremap <Leader>dt :call vimspector#ToggleBreakpoint()<cr>
nnoremap <Leader>dc :call vimspector#GoToCurrentLine()<cr>
nnoremap === :call vimspector#StepOver()<cr>
nnoremap [[[ :call vimspector#StepInto()<cr>
nnoremap ]]] :call vimspector#StepOut()<cr>
nnoremap <Leader>dw :VimspectorWatch
nnoremap <Leader>de <Plug>VimspectorBalloonEval
" Mapping for ToggleTerm
nnoremap <Leader>t <esc>:ToggleTerm<cr>
Plain Text
복사