-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
130 lines (98 loc) · 2.4 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
set autoread
set hidden
set nocompatible
filetype off
au CursorHold,CursorHoldI * checktime
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
set shell=zsh
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'dracula/vim', { 'name': 'dracula' }
Plugin 'editorconfig/editorconfig-vim'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'towolf/vim-helm'
Plugin 'vim-airline/vim-airline'
call vundle#end()
filetype plugin indent on
" Dracula theme
let g:dracula_italic = 0
let g:dracula_colorterm = 0
colorscheme dracula
" EditorConfig
let g:EditorConfig_max_line_indicator = "none"
" FZF
set rtp+=/usr/local/opt/fzf
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
let $FZF_DEFAULT_COMMAND='fd --type f'
" Space and display tabs
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" Match indent of previous line
set autoindent
set smartindent
" Syntax highlighting
syntax on
" Ruler
set ruler
" Highlight search
set hlsearch
set ignorecase
set smartcase
" Line wrapping
set wrap
set textwidth=79
set formatoptions=qrn1
" Indent blocks of text in visual mode
vmap <TAB> >gv
vmap <BS> <gv
" Move between rows when soft wrapping
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
" Write using sudo trick
cmap w!! w !sudo tee % >/dev/null
" Paste across terminals
set clipboard^=unnamed
" Backspace, explicit for macOS
set backspace=indent,eol,start
" Copy and paste with system clipboard
"
" This is for Visual mode, so you can highlight text and then yank it to the
" system clipboard. You can also paste from the system clipboard in Visual
" mode, or do the more common thing of going into Insert (Paste) and pasting.
if has("unix")
let s:uname = substitute(system("uname -s"), "\n", "", "")
" macOS
if s:uname == "Darwin"
vnoremap y "*y
vnoremap Y "*Y
vnoremap p "*p
vnoremap P "*P
" Linux
elseif s:uname == "Linux"
vnoremap y "+y
vnoremap Y "+Y
vnoremap p "+p
vnoremap P "+P
endif
endif
" Show hybrid line numbers
set number relativenumber
highlight LineNr ctermfg=None
" Move between buffers
map <C-Left> <Esc>:bprev<CR>
map <C-Right> <Esc>:bnext<CR>
" Move between splits
map <C-h> <C-W>h
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-l> <C-W>l
" Render Markdown preview
nnoremap <C-m> :MarkdownPreview<CR>