-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
114 lines (96 loc) · 2.54 KB
/
.vimrc
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
" Install vim-plug if not found
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Plugins
call plug#begin()
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'sheerun/vim-polyglot'
Plug 'airblade/vim-gitgutter'
Plug 'raimondi/delimitmate'
Plug 'justinmk/vim-sneak'
Plug 'jszakmeister/vim-togglecursor'
Plug 'machakann/vim-highlightedyank'
call plug#end()
" Options
syntax on
silent! colorscheme catppuccin_mocha
set number relativenumber
set termguicolors
set mouse=a
set autoindent
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set cursorline
set signcolumn=yes
set ignorecase
set incsearch
set hlsearch
set showcmd
set belloff=all
set updatetime=100
set shm+=I
set fillchars+=eob:\
" leader and localleader keys
let mapleader = " "
let maplocalleader = "\\"
" escape insert mode
inoremap jk <Esc>
inoremap kj <Esc>
" window navigation
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <C-h> <C-w>h
" buffers
nnoremap <leader>n :enew<CR>
nnoremap <leader>c :confirm bdelete<CR>
nnoremap <leader>q :confirm quit<CR>
nnoremap <leader>b :ls<CR>:b<Space>
nnoremap <leader>w :write<CR>
" buffer navigation
nnoremap ]b :bnext<CR>
nnoremap [b :bprev<CR>
nnoremap <leader>` :e #<CR>
" fzf
nnoremap <leader>ff :Files<CR>
nnoremap <leader>fg :GFiles<CR>
nnoremap <leader>fb :Buffers<CR>
nnoremap <leader>fo :History<CR>
nnoremap <leader>fw :RG<CR>
nnoremap <leader>f/ :BLines<CR>
nnoremap <leader>fh :Helptags<CR>
" toggle netrw
nnoremap <leader>e :Lex<CR>
" yanking and pasting to system clipboard
nnoremap <leader>y "+y
xnoremap <leader>y "+y
nnoremap Y y$
nnoremap <leader>Y "+y$
" delete and paste to black hole register
xnoremap <leader>p "_dP
nnoremap <leader>d "_d
xnoremap <leader>d "_d
nnoremap <leader>D "_d$
" Plugin Configuration
let g:highlightedyank_highlight_duration = 250
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_winsize = 20
let g:sneak#label = 1
let g:sneak#use_ic_scs = 1
let g:sneak#s_next = 1
let g:delimitMate_expand_cr=1
" Hack fix to make ctrl-l work properly in netrw
autocmd filetype netrw noremap <buffer> <C-l> <C-w>l