Repository navigation
Expand file tree
/
Copy path.vimrc
More file actions
155 lines (133 loc) · 4.22 KB
/
Copy path.vimrc
File metadata and controls
155 lines (133 loc) · 4.22 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
set nocompatible
" so it wouldn't fuck up anything else
set encoding=utf-8
set fileencoding=utf-8
" {{{ VARIABLES
let g:python_recommended_style=0
let g:zig_recommended_style=0
let g:markdown_recommended_style=0
let g:OmniSharp_server_use_net6=1
let g:livepreview_previewer='evince'
let g:csv_default_delim=','
let g:instant_markdown_theme = 'dark'
" }}}
" {{{ PLUGINS
filetype plugin on
call plug#begin('~/.vim/plugged')
Plug 'rakr/vim-one'
Plug 'Valloric/YouCompleteMe'
Plug 'OmniSharp/omnisharp-vim'
Plug 'simeji/winresizer'
Plug 'habamax/vim-godot'
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
Plug 'vuciv/golf'
Plug 'tpope/vim-obsession'
Plug 'stevearc/vim-arduino'
Plug 'sputnick1124/uiua.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'turbio/bracey.vim'
Plug 'chrisbra/csv.vim'
Plug 'puremourning/vimspector'
"Plug 'instant-markdown/vim-instant-markdown', {'for': 'markdown', 'do': 'npm install'}
call plug#end()
" }}}
" {{{ VISUAL STUFF
"for NOT breaking colors
if (has("termguicolors"))
set termguicolors
endif
if has_key(environ(), 'DISPLAY')
colorscheme one
else
colorscheme elflord
endif
set background=dark
syntax on
set tabstop=2 shiftwidth=2 smarttab
set noexpandtab
set nowrap
set numberwidth=4
set number relativenumber
set title
set cursorline
set incsearch hlsearch
set novisualbell noerrorbells
set list
set listchars=tab:│_,trail:•,extends:\#,nbsp:.,precedes:\#
set showbreak=↪\
",tab:|↦,trail:␠,nbsp:
" }}}
" {{{ NON-VISUAL STUFF
set splitright splitbelow
set clipboard=unnamedplus
set autoindent copyindent
set hidden
set mouse=a
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak,*.pyc,*.class,*.docx,*.jpg,*.png,*.gif,*.pdf,*.exe,*.flv,*.img,*.xlsx
set ignorecase smartcase
set showmatch
set foldmethod=marker
set spelllang=en_us,cs
filetype plugin on
" }}}
" {{{ KEYBINDS/REBINDS
" tab navigation
nnoremap <Tab> :tabnext<CR>
nnoremap <S-Tab> :tabprevious<CR>
nnoremap <C-t> :tabnew<CR>
execute "set <M-t>=\033t"
nnoremap <M-t> :tabclose<CR>
map <ScrollWheelLeft> <Nop>
map <ScrollWheelRight> <Nop>
" line from Martin Škarytka
com Undokundo undo
" }}}
" {{{ AUTOCMDs
"TODO: autoclose all terminal windows after :qa not :qa!
" this is for setting and making filetype specific things
fun! SetSpecific()
if &ft =~ 'gitcommit'
setl spell
elseif &ft =~ 'python'
if winwidth(0) > (winheight(0)*2.5)
vertical terminal
else
terminal
endif
wincmd p
endif
endfun
aug FTSpecific
autocmd!
autocmd VimEnter * call SetSpecific()
aug END
aug AutoWriteFile
autocmd!
autocmd BufReadPost,BufNewFile *.py if !(getline(1) =~ '#!\/usr\/bin\/env python3') | 0put = '#!/usr/bin/env python3' | endif " if there ins't hashbang at the begining of the code make it there
autocmd BufReadPost,BufNewFile *.sh if !(getline(1) =~ '#!\/usr\/bin\/env bash') | 0put = '#!/usr/bin/env bash' | endif " if there ins't hashbang at the begining of the code make it there
autocmd BufReadPost,BufNewFile *.scad if !(getline(1) =~ '\$fn\s*=\s*\$preview\s*?\s*\d\+\s:\s*\d\+;') | 0put = '$fn = $preview ? 36 : 72;' | endif " same but with number of fragments
autocmd BufReadPost,BufNewFile *.scad if !(getline(2) =~ 'nothing\s*=\s*\d*\.\d\+;') | 1put = 'nothing=0.01;' | endif " same but for adding miniscule amounts
autocmd BufReadPost,BufNewFile *.scad if !(getline(3) =~ 'use <.*solidpp\.scad>') | 2put = 'use </home/nevim/Documents/openSCAD/solidpp/solidpp.scad>' | endif " same but for adding miniscule amounts
aug END
aug AutoTabbing
autocmd!
autocmd BufReadPost * if !&readonly | setl expandtab | retab 2 | silent! %s/^\(\( \)*\)/\=substitute(submatch(1), " ", "\t", "ge")/ge | exe "norm gg" | setl noexpandtab | endif
autocmd BufReadPost * if !&readonly | silent! %s/\s*$// | exe "norm gg" | endif
autocmd BufReadPost *.yaml if !&readonly | setl expandtab | retab 2 | endif
aug END
" Set linebreak wrap for plaintext files
augroup FileTypeWrap
autocmd!
autocmd FileType plaintex,tex,markdown,html setl wrap linebreak spell breakindent
autocmd FileType plaintext,markdown setl expandtab | retab 2
augroup END
" }}}
" {{{ LSP SETUP
let LSPDir='/home/nevim/.vim/plugged/lsp-examples/vimrc.generated'
if !empty(glob(LSPDir))
execute 'source '.fnameescape(LSPDir)
endif
" }}}