-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
122 lines (95 loc) · 3.7 KB
/
init.vim
File metadata and controls
122 lines (95 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
set nocompatible
set termguicolors
" lazy.nvim보다 먼저 leader를 설정해야 keymap이 일관되게 동작함
let mapleader=" "
" Plugin manager: lazy.nvim (lua/plugins.lua에서 부트스트랩 + spec)
lua require('plugins')
filetype plugin indent on
syntax on
set bg=light
color solarized8
set fileformat=unix backspace=2
set autoindent smartindent expandtab
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp949,korea,iso-2022-kr
set noeb vb t_vb=
set directory=/tmp
command E Neotree toggle
command F FZF
command FA call fzf#vim#files(<q-args>, {'source': 'rg -l --no-ignore-vcs --hidden --iglob !.git ""', 'down': '20%'})
command B Buffers
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --hidden --column --line-number --no-heading --color=always --smart-case '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%') :
\ fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
set hidden
set noequalalways
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nmap <Leader>T :enew<CR>
" Move to the next buffer
nmap <Leader>l :bnext<CR>
nmap <Leader>f :bnext<CR>
" Move to the previous buffer
nmap <Leader>h :bprevious<CR>
nmap <Leader>b :bprevious<CR>
" Close the current buffer
nmap <Leader>bq :bp<bar>sp<bar>bn<bar>bd<CR>
" Show all open buffers and their status
nmap <Leader>bl :ls<CR>
let g:fzf_action = {
\ 'ctrl-t': 'e',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
" airline tabline 변수는 lua/plugins.lua의 init 콜백으로 옮김 (플러그인 로드 전 설정 필요)
set laststatus=2
" blink.cmp의 super-tab preset이 Tab/S-Tab/C-y/C-n/C-p을 처리함
inoremap <C-c> <Esc>
set nofoldenable
"Indents
set ts=4 sw=4 softtabstop=4 modeline
set colorcolumn=80
" Line numbers
set nu
set numberwidth=3
au FileType typescript setl ts=4 sw=4 sts=4 colorcolumn=120
au FileType typescriptreact setl syntax=typescript ts=4 sw=4 sts=4 colorcolumn=120
au FileType javascript setl ts=2 sw=2 sts=2 colorcolumn=120
au FileType yaml setl ts=2 sw=2 sts=2
au FileType ruby setl ts=2 sw=2 sts=2
au FileType yaml setl ts=2 sw=2 sts=2
au FileType html setl ts=4 sw=4 sts=4
au FileType haml setl ts=2 sw=2 sts=2
au FileType php setl ts=2 sw=2 sts=2
au FileType sql setl ts=2 sw=2 sts=2
au FileType python setl ts=4 sw=4 sts=4 completeopt-=preview
au FileType haskell setl ts=8 sw=4 sts=4
au FileType elm setl ts=4 sw=4 sts=4
au FileType make setl noet
au FileType nirum setl ts=4 sw=4 sts=4
au FileType json setl ts=4 sw=4 sts=4
au FileType markdown setl ts=2 sw=2 sts=2 colorcolumn=120
au BufRead,BufNewFile *.pegjs setfiletype pegjs
au FileType pegjs setl ts=2 sw=2 sts=2 colorcolumn=120 syn=javascript
" IMPORTANT: :help Ncm2PopupOpen for more information
set completeopt=noinsert,menuone,noselect
" suppress the annoying 'match x of y', 'The only match' and 'Pattern not
" found' messages
set shortmess+=c
let g:EditorConfig_core_mode = 'external_command'
let g:EditorConfig_exec_path = '/usr/local/bin/editorconfig'
set updatetime=1500
" 외부에서 파일이 변경되면 자동으로 다시 읽기
set autoread
au FocusGained,BufEnter,CursorHold,CursorHoldI *
\ if mode() !~ '\v(c|r.?|!|t)' && getcmdwintype() == '' | checktime | endif
vnoremap // "ly/\V<C-R>=escape(@l,'/\')<CR><CR>
vnoremap ?? "ly:Rg <C-R>=escape(@l,'/\')<CR><CR>
vnoremap ??? "ly:Rg! <C-R>=escape(@l,'/\')<CR><CR>
" LSP keymap은 lua/lsp.lua의 LspAttach autocmd에서 buffer-local로 등록됨
" gd=정의, gy=타입정의, gi=구현, gr=참조, <Leader>r=포맷+저장, <Leader>rn=리네임
lua require('lsp')
lua require('neotree')
lua require('git')
lua require('autoread')