-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprivate_dot_vimrc
142 lines (110 loc) · 2.72 KB
/
private_dot_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
131
132
133
134
135
136
137
138
139
140
141
142
" ${HOME}/.vimrc
" -*- coding: utf-8 -*-
" Disable Python 3 deprication warnings
if has('python3')
silent! python3 1
endif
" Enable all Vim-specific features
set nocompatible
" Set shell to Bash if running Fish
if &shell =~# 'fish$'
if filereadable('/opt/homebrew/bin/bash')
set shell=/opt/homebrew/bin/bash
elseif filereadable('/usr/local/bin/bash')
set shell=/usr/local/bin/bash
elseif filereadable('/bin/bash')
set shell=/bin/bash
else
set shell=sh " Hopefully, we do not get here
endif
endif
" Black Python code formatter
if filereadable(glob("~/.local/pipx/venvs/black/pyvenv.cfg"))
let g:black_virtualenv="~/.local/pipx/venvs/black"
endif
" vim-plug
if filereadable(glob("~/.vim/config/vim-plug.vim"))
source ~/.vim/config/vim-plug.vim
endif
if has("autocmd")
filetype plugin indent on
endif
" Enable syntax highlighting
if has("syntax")
syntax enable
endif
" Enable access to the macOS clipboard
if has("macunix")
set clipboard=unnamed
endif
" Save files in UTF-8
set encoding=utf-8
set fileencoding=utf8
" Remember marks/undo for unsaved buffers
set hidden
" Allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Set default tab stop
set tabstop=4
" Spaces inserted for indentation
set shiftwidth=4
" Expand tabs as spaces
set expandtab
" Set soft tabstop
set softtabstop=4
" Activate TAB auto-completion for file paths
set wildmode=list:longest,full
" Improve statusline tab completion
set wildmenu
" Keep 1024 lines of command line history
set history=1024
" Show the cursor position at all times
set ruler
" Display incomplete commands
set showcmd
" Make search wrap around the file
set wrapscan
" Colorscheme
set t_Co=256
set background=light
let g:solarized_termtrans=1
let g:solarized_termcolors=256
silent! colorscheme solarized
" Highlight current line
set cursorline
highlight CursorLine cterm=NONE ctermbg=187
" Set default line ending warning columns
set colorcolumn=79,99
highlight ColorColumn cterm=NONE ctermbg=187
" Search case sensitive only if contains upper-case
set ignorecase smartcase
" Make the comma the leader key
let mapleader=","
" Informative statusline
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'solarized',
\ }
set noshowmode
" Enable mouse in terminal mode
if has('mouse')
set mouse=a
endif
" Enable autoindent
set autoindent
" Line numbering
set number
set relativenumber
" Better line wrapping
if has("linebreak") && exists("&breakindent")
set linebreak
set breakindent
set showbreak=\ \ \ \
endif
" Split defaults and navigation
set splitbelow
set splitright
nnoremap <C-j> <C-w><C-j>
nnoremap <C-k> <C-w><C-k>
nnoremap <C-l> <C-w><C-l>
nnoremap <C-h> <C-w><C-h>