aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xREADME.md302
-rwxr-xr-x[-rw-r--r--]after/ftdetect/log.vim0
-rw-r--r--after/ftplugin/javascript.vim1
-rwxr-xr-x[-rw-r--r--]after/ftplugin/python.vim0
-rwxr-xr-x[-rw-r--r--]after/indent/html5.vim0
-rwxr-xr-x[-rw-r--r--]after/indent/php.vim0
-rwxr-xr-x[-rw-r--r--]after/indent/yaml.vim0
-rwxr-xr-x[-rw-r--r--]after/syntax/c.vim0
-rwxr-xr-x[-rw-r--r--]after/syntax/log.vim2
-rwxr-xr-x[-rw-r--r--]after/syntax/markdown.vim12
-rw-r--r--doc/coderonline-vim.pngbin91868 -> 0 bytes
-rw-r--r--doc/git2
-rw-r--r--doc/git.txt3
-rw-r--r--doc/gtk.css7
-rw-r--r--doc/list-of-filetypes.txt175
-rw-r--r--doc/readme.md15
-rw-r--r--doc/screen.txt9
-rw-r--r--doc/shortcuts.txt206
-rw-r--r--gvimrc2
-rw-r--r--init-mini.lua90
-rw-r--r--init.lua271
-rw-r--r--lua/plugins/cmp.lua157
-rw-r--r--lua/plugins/colorizer.lua6
-rw-r--r--lua/plugins/colorscheme.lua6
-rw-r--r--lua/plugins/devicons.lua11
-rw-r--r--lua/plugins/fzf.lua4
-rw-r--r--lua/plugins/gitsigns.lua6
-rw-r--r--lua/plugins/lspsaga.lua10
-rw-r--r--lua/plugins/orgmode.lua11
-rw-r--r--lua/plugins/popup.lua5
-rw-r--r--lua/plugins/telescope.lua15
-rw-r--r--lua/plugins/treesitter.lua20
m---------pack/all/start/fzf0
m---------pack/all/start/fzf.vim0
m---------pack/all/start/vim-colorscheme-papercolor0
m---------pack/all/start/vim-editorconfig0
m---------pack/all/start/vim-fancy-line0
m---------pack/all/start/vim-karlmarks0
m---------pack/all/start/vim-mercenary0
m---------pack/all/start/vim-recently-used0
m---------pack/all/start/vim-under-the-cursor0
m---------pack/nvim/start/nvim-cmp0
m---------pack/nvim/start/nvim-cmp-buffer0
m---------pack/nvim/start/nvim-cmp-lsp-signature-help0
m---------pack/nvim/start/nvim-cmp-nvim-lsp0
m---------pack/nvim/start/nvim-colorizer0
m---------pack/nvim/start/nvim-lsp0
m---------pack/nvim/start/nvim-lspconfig0
m---------pack/nvim/start/nvim-lua-language-server0
m---------pack/nvim/start/nvim-plenary0
m---------pack/nvim/start/nvim-telescope0
m---------pack/nvim/start/nvim-treesitter0
m---------pack/nvim/start/nvim-vsnip0
m---------pack/vim/opt/vim-youcompleteme0
-rw-r--r--plugin/lsp.nvim1
-rw-r--r--plugin/max-find-bash.vim11
-rw-r--r--plugin/max-fix-colorschemes.vim62
-rw-r--r--plugin/max-set-window-title.vim22
-rw-r--r--plugin/netrw.vim16
-rw-r--r--plugin/vimdiff.vim4
-rw-r--r--plugin/youcompleteme.vim21
-rw-r--r--utils/Xresources192
-rw-r--r--utils/applications/gvim-buffer.desktop10
-rw-r--r--utils/applications/gvim.desktop10
-rw-r--r--utils/applications/nvim.desktop10
-rwxr-xr-xutils/applications/vim.desktop15
-rw-r--r--utils/bashrc46
-rw-r--r--utils/default-font.conf82
-rw-r--r--utils/default-font.conf.old49
-rw-r--r--utils/gtk-3.0.css132
-rw-r--r--utils/gtkrc-2.01
-rw-r--r--utils/locale.conf14
-rw-r--r--utils/update.sh1
-rw-r--r--utils/xinputrc3
-rw-r--r--vimrc414
-rw-r--r--vimrc-common379
77 files changed, 1108 insertions, 1736 deletions
diff --git a/.gitignore b/.gitignore
index 8b51aea..429ea9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
6!spell/.keep 6!spell/.keep
7/systags 7/systags
8/pack/max/** 8/pack/max/**
9shada.file
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..0d4f81b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,302 @@
1# Installation
2
3 git clone http://git.entwicklerseite.de/vim ~/.config/nvim/
4 ln -s ~/.config/nvim ~/.vim
5
6# Overview
7
8- `init.lua` :: my every day neovim config. It sources my vimrc (see below)
9
10- `init-mini.lua` :: if you want to start from scratch this is a good start. It
11 sets up nvim with a language server to support the creation of a new config.
12
13- `vimrc` :: commented version of a vimrc with sane defaults
14
15- `gvimrc` :: configures the gui of gvim and sources the vimrc
16
17
18```
19 .
20├──  after
21│ ├──  ftdetect
22│ │ └──  log.vim
23│ ├──  ftplugin
24│ │ └──  python.vim
25│ ├──  indent
26│ │ ├──  html5.vim
27│ │ ├──  php.vim
28│ │ └──  yaml.vim
29│ └──  syntax
30│ ├──  c.vim
31│ ├──  log.vim
32│ └──  markdown.vim
33├──  gvimrc
34├──  init-mini.lua
35├──  init.lua
36├──  README.md
37└──  vimrc
38```
39
40
41# Cheat sheet
42For different working scenarios.
43
44## vim
45
46- use `<C-d>` to expand autocompletion on the `:` command line. That works for
47 example for `:setfiletype <C-d>` to show all available filetypes.
48
49- use `gw` or `gq` in visual mode to break selected text at the current
50 textwidth (configured with `set textwidth=80` for example)
51
52
53## general
54
55 :viusage = summary of all keyboard shortcuts
56 :options = shows currently :set options (with descriptions)
57 leader key = usually set to backslash expects a quick command
58
59### normal mode
60
61 f{char} = move cursor to the character {char}
62 gf = open file under cursor
63 <C-w>gf = open file under cursor in a tab
64 <C-w>] = jump to the tag under the cursor in a new window
65 <C-t> = jump back from where that ^ brought you
66 K = keyword lookup for the word under the cursor (see :help kp)
67 w = next word
68 e = end of word (=inner word)
69
70 @see: :h text-objects
71 ci' = change between single quote
72 ci" = change between double quote
73 ci( = change between brace
74 cit = change XML Tag
75 ciw = select inner word
76 caw = select 'a word'
77 " where c can be replaced by v for visual mode
78
79 :%s/foo/bar/g = replace all foo with bar
80 :g/foo/s/bar//g = on lines with foo replace bar with nothing
81 :g!/foo/s/bar//g = on lines not containing foo replace bar with nothing
82 :g!/^foo/execute("normal dd") delete lines starting with foo
83
84 flags, end: after the last /
85 g = replace globally (all occurances on the current line)
86 c = confirm each replace, also allows to switch to g (use the flag to see the help message)
87 e = places the cursor in the end of the selection
88
89 flags, within the search string:
90 \v = use very magic search (more like perl)
91 \V = use no very magic, more like searching verbatim
92 \zs .. \ze = mark begin and end of a sub pattern (like perl lookaround assertions)
93
94### visual mode (with selected lines)
95
96 gq = formats text so that it fits in whatever :set textwidth was set
97 iB = select block between curly braces (:help object-select)
98
99### command line mode
100command line mode begins with : and has its own key mappings starting with c
101like in cnormap
102
103 :spell [word] = adds a word to the current dictionary (no mistake any more)
104 :set list = display non printable characters
105 :retab = replaces tabs with spaces
106 :set expandtab = in insert mode: replace tab with spaces
107 :Explore = cli version open file dialog (file explorer)
108 :Lex = use netrw as project drawer (stays open in its own window)
109 :only = 'maximize' current buffer
110
111
112### insert mode
113
114 <c-r><c-w> = auto completion with the word under the cursor (interesting with incsearch)
115 <c-a> = expand pattern from command line (e.g. *.txt)
116
117### navigation
118
119 <CTRL-]> = look up the tag under the cursor (help links as well)
120 <CTRL-T> = return back from tag under the cursor
121 gd = jump to the declaration of the variable under the cursor
122
123### macros
124record and play back a series of vim commands
125
126 qa = start (q) macro recording in register a (can be anything)
127 q = stop macro recording
128 @a = replay macro a
129 :'<,'>normal @a = apply a to every line in the current selection
130 :reg = lists all registers (including those with macros in them)
131
132### registers
133notice, that registers get used for both: macro recordings and copying text
134
135 :reg = shows contents of all registers
136 "0p = pasts from register 0, which is the same as "", but not overwritten by dd
137 "ap = same for register a
138 "0yy = yanks to register 0 (same as y by itself)
139 "ay = yanks current selection to register a (in visual mode)
140
141### marker
142
143 ma = set marker a-z (a in this case)
144 mA = create a session persistent file marker which can be used to reopen a file (not bound to the buffer)
145 `a = go to marker a (line & column)
146 'a = go to marker a (line, first non blank), same as `a^
147
148### other hotkeys
149
150 <C-A>, <C-X> = increment, decrement number under the cursor
151
152## windows
153
154 <C-w>v = splits buffer vertically (screen uses |)
155 <C-w>s = splits buffer horizontally (same as screen)
156 <C-w>w = moves the cursor to the next window and back
157 <C-w>[dir] = moves the cursor in that direction (use hjkl or arrow keys)
158 <C-w>[HK] = make a vertical split horizontal and vice versa
159 <C-w>o = only: close all other windows
160 <C-w>c = close: current window in which the cursor sits
161
162### vimdiff
163
164 do = get changes from other window into the current
165 dp = put changes from current window into the other
166 ]c = jump to the next change
167 [c = jump to the prevous change
168
169### folds
170
171 za = toggle a fold
172 zM = close all folds
173 zR = opens all folds (unfold all)
174 zE = eliminates all folds
175
176### buffers
177
178 :bn = buffer next
179 :bp = buffer previous
180 :bd = buffer dispatch (close)
181 :b <tab> = switch buffer by name (use <tab> and <return>)
182 :set nobuflisted = hide buffer in buffer list (great for neovim's terminal)
183
184### args
185
186 :n **/*.c = opens all files with that name or type in buffers and also fills the argument list
187
188### special
189
190 g CTRL-g = display file properties including word and char count
191 q: = show command history and use it like a normal buffer
192 z= = show spellcheck suggestions
193
194### completions
195
196 CTRL-O = display completions: omnicomplete (context dependant completions)
197 CTRL-X CTRL-F = display completions: file name (using vim-internals omnicomplete)
198 CTRL-N CTRL-P = display completions: file keywords
199 CTRL-K = display completions: dictionary
200 CTRL-T = display completions: thesaurus
201 CTRL-I = display completions: include files
202 CTRL-] = display completions: tags
203 CTRL-D = display completions: (marcro-) definitions
204 CTRL-V = display completions: vim command line
205 CTRL-U = display completions: user-defined
206
207### annoyances
208 gv = visual mode: reselect last selection
209 CTRL-o = lets the caret jump back to the previous location
210 CTRL-l = redraws the complete screen
211 CTRL-R<register> = in insert mode and command line: paste contents of <register> (e.g. : for last command, * for clipboard)
212 CTRL-R = in normal mode: redoes what has been undone with u
213 "<register>p = in normal mode: paste paste contents of <register>
214
215### registers
216 "/ = last search expression
217 ": = last command entered
218 "= = expression register (to do calculations or call vim functions)
219
220### netrw
221 :Lex = open the netrw-view as project drawer
222 gn = makes the directory under the cursor the root directory
223 a = toggles display of hidden files
224
225### filetype:css
226
227 viB:sort = sort inner block by name
228
229### vim commands
230
231 :for i in range(1,12) | put ='2016-'.i | endfor
232
233### debugging
234
235 :profile! start /tmp/profile.log
236 :profile func *
237 :profile file *
238 " At this point do slow actions
239 :profdel *
240 :e /tmp/profile.log
241 " add a break point to a vim script (like vimrc) to invoke the internal debugger
242 :breakadd here
243 :finish = from within a viml-script: stop sourcing it
244
245### substitutions
246
247 delete all comments: %s/\/\*\*< [^(\*\/)]*\*\///g
248 remove empty lines: global/^$/d
249 remove non-empty lines: v/^$/d
250
251### programs
252
253 gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3)
254
255### vim modeline
256
257 filetype can have multiple values, like python.django
258 The last line can be a mode line, which holds settings like tab width:
259
260
261
262## git
263
264 undo last commit: git reset HEAD~
265 diff two branches: git diff branch1 branch2 path/to/file
266
267
268
269To `~/.gitconfig` add:
270 [alias]
271 branchvv = for-each-ref --sort='committerdate:raw' --format='%(HEAD)%(if)%(HEAD)%(then)%(color:bold green)%(end) %(align:width=24)%(refname:short)%(end) %(objectname:short) %(color:bold blue)%(committerdate:iso)%(color:reset) %(if)%(upstream)%(then)[%(color:blue)%(upstream:short)%(color:reset)] %(end)%(subject)' refs/heads
272
273Provides you with `git branchvv`, a command that works similar to `git branch`,
274but sorts the branches by modification date and displays them.
275
276
277# gnu screen
278
279To run Vim in a gnu screen session:
280
281 TERM=vte-256color screen vim
282
283But if you are using another terminal there may be further options with even
284more capabilities. Starting point for you search could be something like:
285
286 find /usr/share/terminfo/ | grep screen | grep 256
287
288# gvim
289
290Change the default brackground of applications if you see an ugly grey border
291around your beatiful theme:
292
293```
294/* to be saved as ~/.config/gtk-3.0/gtk.css
295 * thanks to http://stackoverflow.com/users/6899000/proprefenetre */
296@define-color YOUR_BACKGROUND_COLOR #rrggbb;
297
298window#vim-main-window {
299 background-color: @YOUR_BACKGROUND_COLOR;
300}
301```
302
diff --git a/after/ftdetect/log.vim b/after/ftdetect/log.vim
index 8203171..8203171 100644..100755
--- a/after/ftdetect/log.vim
+++ b/after/ftdetect/log.vim
diff --git a/after/ftplugin/javascript.vim b/after/ftplugin/javascript.vim
deleted file mode 100644
index ce0e6f2..0000000
--- a/after/ftplugin/javascript.vim
+++ /dev/null
@@ -1 +0,0 @@
1" set number
diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim
index a5c454a..a5c454a 100644..100755
--- a/after/ftplugin/python.vim
+++ b/after/ftplugin/python.vim
diff --git a/after/indent/html5.vim b/after/indent/html5.vim
index 94baa87..94baa87 100644..100755
--- a/after/indent/html5.vim
+++ b/after/indent/html5.vim
diff --git a/after/indent/php.vim b/after/indent/php.vim
index ef723a6..ef723a6 100644..100755
--- a/after/indent/php.vim
+++ b/after/indent/php.vim
diff --git a/after/indent/yaml.vim b/after/indent/yaml.vim
index 3027571..3027571 100644..100755
--- a/after/indent/yaml.vim
+++ b/after/indent/yaml.vim
diff --git a/after/syntax/c.vim b/after/syntax/c.vim
index 4c3b3f0..4c3b3f0 100644..100755
--- a/after/syntax/c.vim
+++ b/after/syntax/c.vim
diff --git a/after/syntax/log.vim b/after/syntax/log.vim
index 44223e6..99b677f 100644..100755
--- a/after/syntax/log.vim
+++ b/after/syntax/log.vim
@@ -14,7 +14,7 @@ syn match Info / INFO / fold
14syn match Pass / PASS / fold 14syn match Pass / PASS / fold
15 15
16 16
17silent! lvimgrep /[^ ]* \(ERROR\|WARNING\|FAIL\) / % 17silent! lvimgrep /\(ERROR\|WARNING\|FAIL\)/ %
18lopen 12 18lopen 12
19 19
20 20
diff --git a/after/syntax/markdown.vim b/after/syntax/markdown.vim
index 7bdbf46..e012ee4 100644..100755
--- a/after/syntax/markdown.vim
+++ b/after/syntax/markdown.vim
@@ -1,12 +1,12 @@
1" Custom conceal 1" Custom conceal
2" syntax region todolist start="^\s*[\+-\*x ]" end="\s" contained keepend 2" syntax region todolist start="^\s*[\+-\*x ]" end="\s" contained keepend
3 3
4 4syntax match markdownConceal "\[\ \]" conceal cchar=󰄱
5syntax match markdownConceal "\[\ \]" contained conceal cchar= 5syntax match markdownConceal "\[x\]" conceal cchar=
6syntax match markdownConceal "\[x\]" contained conceal cchar= 6syntax match markdownConceal "\[v\]" conceal cchar=󰄵
7syntax match markdownConceal "*" contained conceal cchar= 7syntax match markdownConceal "*" conceal cchar=
8syntax match markdownConceal "-" contained conceal cchar= 8syntax match markdownConceal "-" conceal cchar=
9syntax match markdownConceal "+" contained conceal cchar= 9syntax match markdownConceal "+" conceal cchar=
10 10
11syntax region 11syntax region
12 \ markdownItemization 12 \ markdownItemization
diff --git a/doc/coderonline-vim.png b/doc/coderonline-vim.png
deleted file mode 100644
index 156ff3a..0000000
--- a/doc/coderonline-vim.png
+++ /dev/null
Binary files differ
diff --git a/doc/git b/doc/git
deleted file mode 100644
index 1205d00..0000000
--- a/doc/git
+++ /dev/null
@@ -1,2 +0,0 @@
1undo last commit: git reset HEAD~
2diff two branches: git diff branch1 branch2 path/to/file
diff --git a/doc/git.txt b/doc/git.txt
deleted file mode 100644
index 517f998..0000000
--- a/doc/git.txt
+++ /dev/null
@@ -1,3 +0,0 @@
1GIT_PAGER=less git config --list | awk 'match($0, "submodule.(.*).url=(.*)",q){ system("echo git submodule add " q[2] " " q[1]) }'
2
3branchvv = for-each-ref --sort='committerdate:raw' --format='%(HEAD)%(if)%(HEAD)%(then)%(color:bold green)%(end) %(align:width=24)%(refname:short)%(end) %(objectname:short) %(color:bold blue)%(committerdate:iso)%(color:reset) %(if)%(upstream)%(then)[%(color:blue)%(upstream:short)%(color:reset)] %(end)%(subject)' refs/heads
diff --git a/doc/gtk.css b/doc/gtk.css
deleted file mode 100644
index 5f15661..0000000
--- a/doc/gtk.css
+++ /dev/null
@@ -1,7 +0,0 @@
1/* to be saved as ~/.config/gtk-3.0/gtk.css
2 * thanks to http://stackoverflow.com/users/6899000/proprefenetre */
3@define-color YOUR_BACKGROUND_COLOR #rrggbb;
4
5window#vim-main-window {
6 background-color: @YOUR_BACKGROUND_COLOR;
7}
diff --git a/doc/list-of-filetypes.txt b/doc/list-of-filetypes.txt
deleted file mode 100644
index 9752c6a..0000000
--- a/doc/list-of-filetypes.txt
+++ /dev/null
@@ -1,175 +0,0 @@
1# this list can be generated with ':setfiletype <C-d>'. I have copied it to
2# make it searchable.
3
42html erlang master sinda
5HGAnnotate eruby matlab sindacmp
6PKGBUILD esmtprc maxima sindaout
7a2ps esqlc mel sisu
8a65 esterel messages skill
9aap eterm mf sl
10abap euphoria3 mgl slang
11abaqus euphoria4 mgp slice
12abc eviews mib slim
13abel exim mix slpconf
14acedb expect mma slpreg
15ada exports mmix slpspi
16aflex falcon mmp slrnrc
17ahdl fan modconf slrnsc
18alsaconf fasm model sm
19amiga fdcc modsim3 smarty
20aml fetchmail modula2 smcl
21ampl fgl modula3 smil
22ansible fish monk smith
23ansible_hosts flexwiki moo sml
24ansible_template focexec mp snnsnet
25ant form mplayerconf snnspat
26antlr forth mrxvtrc snnsres
27apache fortran msidl snobol4
28apachestyle foxpro msmessages solidity
29aptconf framescript msql spec
30arch freebasic mupad specman
31arduino fstab mush spice
32art fvwm mustache splint
33asciidoc fvwm2m4 muttrc spup
34asm gdb mysql spyce
35asm68k gdmo named sql
36asmh8300 gedcom nanorc sqlanywhere
37asn git nasm sqlforms
38aspperl gitcommit nastran sqlhana
39aspvbs gitconfig natural sqlinformix
40asterisk gitolite ncf sqlj
41asteriskvm gitrebase netrc sqloracle
42atlas gitsendemail netrw sqr
43augeas gkrellmrc nginx squid
44autohotkey glsl nim srec
45autoit gnash ninja sshconfig
46automake gnomecat nix sshdconfig
47ave gnuplot nosyntax st
48avra go nqc stata
49awk godefstack nroff stp
50ayacc godoc nsis strace
51b gohtmltmpl obj stylus
52baan gotexttmpl objc sudoers
53basic gp objcpp svg
54bc gpg ocaml svn
55bdf gprof occam swift
56bib grads octave syncolor
57bib_latexSuite gretl omnimark synload
58bindzone groff opencl syntax
59blade groovy openroad sysctl
60blank group opl systemd
61bst grub ora systemverilog
62btm gsp pamconf tads
63bzl gtkrc papp tags
64bzr haml pascal tak
65c hamster passwd takcmp
66cabal handlebars pcap takout
67calendar haskell pccts tap
68catalog haste pdf tar
69cdl hastepreproc perl taskdata
70cdrdaoconf haxe perl6 taskedit
71cdrtoc haxe_extended pf tasm
72cf hb pfmain tcl
73cfg help pgsql tcsh
74ch hercules php teraterm
75chaiscript hex phtml terminfo
76change hgcommit pic tex
77changelog hitest pike tex_LatexBox
78chaskell hog pilrc tex_latexSuite
79cheetah hostconf pine texinfo
80chill hostsaccess pinfo texmf
81chordpro hss plaintex text
82cl html plantuml textile
83clean html5 pli tf
84clipper htmlcheetah plm thrift
85clojure htmldjango plp tidy
86cmake htmlm4 plsql tilde
87cmake-indent htmlos po tli
88cmake-syntax hxml pod tmux
89cmusrc ia64 postscr tomdoc
90cobol ibasic pov toml
91coco icemenu povini tpp
92coffee icon ppd trasys
93color_coded idl ppwiz treetop
94colortest idlang prescribe trustees
95conaryrecipe indent privoxy tsalt
96conf inform procmail tsscl
97config initex progress tssgm
98context initng prolog tssop
99cpp inittab promela tt2
100cql ipfilter proto tt2html
101crm ishd protocols tt2js
102crontab iss ps1 twig
103cryptol ist ps1xml typescript
104crystal j psf uc
105cs jal ptcap udevconf
106csc jam pug udevperm
107cscope_plus jargon puppet udevrules
108csdl jasmine purescript uil
109csh java purifylog updatedb
110csp javacc pyrex upstart
111css javascript python upstreamdat
112cterm jess qf upstreaminstalllog
113ctrlh jgraph qml upstreamlog
114cucumber jinja2 quake upstreamrpt
115cuda jovial r usserverlog
116cupl jproperties racc usw2kagtlog
117cuplsim json radiance vala
118cuda jovial r usserverlog
119cupl jproperties racc usw2kagtlog
120cuplsim json radiance vala
121cvs jsp ragel valgrind
122cvsrc jst ratpoison vb
123cweb jsx rc vbnet
124cynlib julia rcs vcl
125cynpp kconfig rcslog velocity
126d kivy readline vera
127dart kix rebol verilog
128datascript kotlin redif verilogams
129dcd kscript registry vgrindefs
130dcl kwt remind vhdl
131debchangelog lace resolv vim
132debcontrol latextoc reva vimgo
133debsources latte rexx viminfo
134def ld rhelp virata
135denyhosts ldapconf rib vmasm
136desc ldif rmd voscm
137desktop less rnc vrml
138dictconf lex rng vroom
139dictdconf lftp rnoweb vsejcl
140diff lhaskell robots vundlelog
141dircolors libao rpcgen wdiff
142dirpager lifelines rpl web
143diva lilo rrst webmacro
144django limits rspec wget
145dns liquid rst whitespace
146dnsmasq lisp rtf winbatch
147docbk lite ruby wml
148docbksgml litestep rust wsh
149docbkxml logcheck samba wsml
150dockerfile loginaccess sas wvdial
151dosbatch logindefs sass xbl
152dosini logtalk sather xdefaults
153dot lotos sbt xf86conf
154doxygen lout scala xhtml
155dracula lpc scala.xpt xinetd
156dsl lprolog scheme xkb
157dtd lscript scilab xmath
158dtml lsl screen xml
159dtrace lss scss xmodmap
160dts lua sd xpm
161dylan lynx sdc xpm2
162dylanintr m4 sdl xquery
163dylanlid mail sed xs
164ecd mailaliases sendpr xsd
165edif mailcap sensors xsl
166eelixir make services xslt
167eiffel mallard setserial xxd
168elf man sgml yacc
169elinks manconf sgmldecl yaml
170elixir manual sgmllnx z8a
171elm maple sh zimbu
172elmfilt markdown sicad zsh
173ember-script masm sieve
174emblem mason simula
175
diff --git a/doc/readme.md b/doc/readme.md
deleted file mode 100644
index 5ea6da4..0000000
--- a/doc/readme.md
+++ /dev/null
@@ -1,15 +0,0 @@
1vim configuration
2=================
3
4This is the configuration I am using.
5
6
7Screenshot
8----------
9
10<a href="/vim/plain/doc/coderonline-vim.png">
11 <img src="/vim/plain/doc/coderonline-vim.png" width="720" alt="screenshot of vim" />
12</a>
13
14
15
diff --git a/doc/screen.txt b/doc/screen.txt
deleted file mode 100644
index 5c375d2..0000000
--- a/doc/screen.txt
+++ /dev/null
@@ -1,9 +0,0 @@
1To run vim inside a screen session:
2
3TERM=vte-256color screen vim
4
5works very well. But if you are using another terminal you may be interested in
6other possibilities, like this:
7
8find /usr/share/terminfo/ | grep screen | grep 256
9
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt
deleted file mode 100644
index 5e911ea..0000000
--- a/doc/shortcuts.txt
+++ /dev/null
@@ -1,206 +0,0 @@
1:viusage = summary of all keyboard shortcuts
2:options = shows currently :set options (with descriptions)
3leader key = usually set to backslash expects a quick command
4
5
6[normal mode]
7f{char} = move cursor to the character {char}
8gf = open file under cursor
9<C-w>gf = open file under cursor in a tab
10<C-w>] = jump to the tag under the cursor in a new window
11<C-t> = jump back from where that ^ brought you
12K = keyword lookup for the word under the cursor (see :help kp)
13w = next word
14e = end of word (=inner word)
15
16
17@see: :h text-objects
18ci' = change between single quote
19ci" = change between double quote
20ci( = change between brace
21cit = change XML Tag
22ciw = select inner word
23caw = select 'a word'
24" where c can be replaced by v for visual mode
25
26:%s/foo/bar/g = replace all foo with bar
27:g/foo/s/bar//g = on lines with foo replace bar with nothing
28:g!/foo/s/bar//g = on lines not containing foo replace bar with nothing
29:g!/^foo/execute("normal dd") delete lines starting with foo
30
31flags, end: after the last /
32g = replace globally (all occurances on the current line)
33c = confirm each replace, also allows to switch to g (use the flag to see the help message)
34e = places the cursor in the end of the selection
35
36flags, within the search string:
37\v = use very magic search (more like perl)
38\V = use no very magic, more like searching verbatim
39\zs .. \ze = mark begin and end of a sub pattern (like perl lookaround assertions)
40
41
42
43[visual mode] # with selected lines
44gq = formats text so that it fits in whatever :set textwidth was set
45iB = select block between curly braces (:help object-select)
46
47
48[commands]
49command line mode begins with : and has its own key mappings starting with c like in cnormap
50
51:spell [word] = adds a word to the current dictionary (no mistake any more)
52:set list = display non printable characters
53:retab = replaces tabs with spaces
54:set expandtab = in insert mode: replace tab with spaces
55:Explore = cli version open file dialog (file explorer)
56:Lex = use netrw as project drawer (stays open in its own window)
57:only = 'maximize' current buffer
58
59<c-r><c-w> = auto completion with the word under the cursor (interesting with incsearch)
60<c-a> = expand pattern from command line (e.g. *.txt)
61
62
63[navigation]
64<CTRL-]> = look up the tag under the cursor (help links as well)
65<CTRL-T> = return back from tag under the cursor
66gd = jump to the declaration of the variable under the cursor
67
68
69[macros] # record and play back a series of vim commands
70qa = start (q) macro recording in register a (can be anything)
71q = stop macro recording
72@a = replay macro a
73:'<,'>normal @a = apply a to every line in the current selection
74:reg = lists all registers (including those with macros in them)
75
76[registers]
77notice, that registers get used for both: macro recordings and copying text
78
79:reg = shows contents of all registers
80"0p = pasts from register 0, which is the same as "", but not overwritten by dd
81"ap = same for register a
82"0yy = yanks to register 0 (same as y by itself)
83"ay = yanks current selection to register a (in visual mode)
84
85
86[marker]
87ma = set marker a-z (a in this case)
88mA = create a session persistent file marker which can be used to reopen a file (not bound to the buffer)
89`a = go to marker a (line & column)
90'a = go to marker a (line, first non blank), same as `a^
91
92
93
94[hotkeys]
95<C-A>, <C-X> = increment, decrement number under the cursor
96
97
98[windows]
99<C-W>v = splits buffer vertically (screen uses |)
100<C-W>s = splits buffer horizontally (same as screen)
101<C-W>w = moves the cursor to the next window and back
102<C-W>[dir] = moves the cursor in that direction (use hjkl or arrow keys)
103<C-W>[HK] = make a vertical split horizontal and vice versa
104<C-W>o = only: close all other windows
105<C-W>c = close: current window in which the cursor sits
106
107
108[vimdiff]
109do = get changes from other window into the current
110dp = put changes from current window into the other
111]c = jump to the next change
112[c = jump to the prevous change
113
114[folds]
115za = toggle a fold
116zM = close all folds
117zR = opens all folds (unfold all)
118zE = eliminates all folds
119
120
121[buffers]
122:bn = buffer next
123:bp = buffer previous
124:bd = buffer dispatch (close)
125:b <tab> = switch buffer by name (use <tab> and <return>)
126:set nobuflisted = hide buffer in buffer list (great for neovim's terminal)
127
128[args]
129:n **/*.c = opens all files with that name or type in buffers and also fills the argument list
130
131
132[special]
133g CTRL-g = display file properties including word and char count
134q: = show command history and use it like a normal buffer
135z= = show spellcheck suggestions
136
137
138[completions]
139CTRL-O = display completions: omnicomplete (context dependant completions)
140
141CTRL-X CTRL-F = display completions: file name (using vim-internals omnicomplete)
142CTRL-N CTRL-P = display completions: file keywords
143CTRL-K = display completions: dictionary
144CTRL-T = display completions: thesaurus
145CTRL-I = display completions: include files
146CTRL-] = display completions: tags
147CTRL-D = display completions: (marcro-) definitions
148CTRL-V = display completions: vim command line
149CTRL-U = display completions: user-defined
150
151
152[annoyances]
153gv = visual mode: reselect last selection
154CTRL-o = lets the caret jump back to the previous location
155CTRL-L = redraws the complete screen
156CTRL-R<register> = in insert mode and command line: paste contents of <register> (e.g. : for last command, * for clipboard)
157CTRL-R = in normal mode: redoes what has been undone with u
158"<register>p = in normal mode: paste paste contents of <register>
159
160[registers]
161"/ = last search expression
162": = last command entered
163"= = expression register (to do calculations or call vim functions)
164
165
166
167[netrw]
168:Lex = open the netrw-view as project drawer
169gn = makes the directory under the cursor the root directory
170a = toggles display of hidden files
171
172[filetype:css]
173viB:sort = sort inner block by name
174
175[vim commands]
176:for i in range(1,12) | put ='2016-'.i | endfor
177
178[fancy utf-8 symbols]
179
180
181[debugging]
182:profile! start /tmp/profile.log
183:profile func *
184:profile file *
185" At this point do slow actions
186:profdel *
187:e /tmp/profile.log
188" add a break point to a vim script (like vimrc) to invoke the internal debugger
189:breakadd here
190
191:finish = from within a viml-script: stop sourcing it
192
193[substitutions]
194delete all comments: %s/\/\*\*< [^(\*\/)]*\*\///g
195remove empty lines: global/^$/d
196remove non-empty lines: v/^$/d
197
198[programs]
199gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3)
200
201
202[vim modeline]
203filetype can have multiple values, like python.django
204The last line can be a mode line, which holds settings like tab width:
205
206# vim: noai:ts=2:sw=2 filetype=dosini.text
diff --git a/gvimrc b/gvimrc
index eda4fc7..77bfa32 100644
--- a/gvimrc
+++ b/gvimrc
@@ -28,3 +28,5 @@ if has("gui_running")
28 " like in the terminal: use Ctrl-shift-v for paste in vim's command editor 28 " like in the terminal: use Ctrl-shift-v for paste in vim's command editor
29 cnoremap <c-s-v> <c-r>* 29 cnoremap <c-s-v> <c-r>*
30endif 30endif
31
32exec ":source " . fnamemodify(expand("$MYVIMRC"), ":p:h") . "/vimrc"
diff --git a/init-mini.lua b/init-mini.lua
new file mode 100644
index 0000000..0ac8d1e
--- /dev/null
+++ b/init-mini.lua
@@ -0,0 +1,90 @@
1local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2if not (vim.uv or vim.loop).fs_stat(lazypath) then
3 vim.fn.system({
4 "git",
5 "clone",
6 "--filter=blob:none",
7 "https://github.com/folke/lazy.nvim.git",
8 "--branch=stable", -- latest stable release
9 lazypath,
10 })
11end
12vim.opt.rtp:prepend(lazypath)
13require("lazy").setup(plugins, opts)
14
15
16vim.opt.number = true
17
18vim.opt.shiftwidth = 2
19vim.opt.tabstop = 2
20vim.opt.softtabstop = 2
21
22
23require('gitsigns').setup()
24
25local cmp = require'cmp'
26cmp.setup({
27 snippet = {
28 -- REQUIRED - you must specify a snippet engine
29 expand = function(args)
30 require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
31 vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
32 end,
33 },
34 mapping = cmp.mapping.preset.insert({
35 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
36 ['<C-f>'] = cmp.mapping.scroll_docs(4),
37 ['<C-Space>'] = cmp.mapping.complete(),
38 ['<C-e>'] = cmp.mapping.abort(),
39 ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
40 }),
41 sources = cmp.config.sources({
42 { name = 'nvim_lsp' },
43 { name = 'luasnip' }, -- For luasnip users.
44 }, {
45 { name = 'buffer' },
46 })
47})
48
49-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
50cmp.setup.cmdline({ '/', '?' }, {
51 mapping = cmp.mapping.preset.cmdline(),
52 sources = {
53 { name = 'buffer' }
54 }
55})
56
57-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
58cmp.setup.cmdline(':', {
59 mapping = cmp.mapping.preset.cmdline(),
60 sources = cmp.config.sources({
61 { name = 'path' }
62 }, {
63 { name = 'cmdline' }
64 }),
65 matching = { disallow_symbol_nonprefix_matching = false }
66})
67
68
69require'cmp'.setup {
70 sources = {
71 { name = 'nvim_lua' }
72 }
73}
74
75-- Set up lspconfig.
76local capabilities = require('cmp_nvim_lsp').default_capabilities()
77require("neodev").setup({
78 capabilities = capabilities,
79})
80-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
81require('lspconfig').lua_ls.setup({
82 capabilities = capabilities,
83 settings = {
84 Lua = {
85 diagnostics = {
86 globals = {'vim'}
87 }
88 }
89 }
90})
diff --git a/init.lua b/init.lua
index 2dc45ee..a68778d 100644
--- a/init.lua
+++ b/init.lua
@@ -1,213 +1,80 @@
1vim.cmd('source ~/.vim/vimrc') 1--------------------------------------------------------------------------------
2 2-- vim options, first sourced from vimrc, then appended by Neovim specific stuff
3vim.opt.termguicolors = true 3--------------------------------------------------------------------------------
4vim.opt.exrc = true 4local configdir = vim.fn.fnamemodify(vim.fn.expand("$MYVIMRC"), ":p:h")
5vim.opt.foldmethod = 'syntax' 5vim.cmd('source ' .. configdir .. '/vimrc')
6 6
7if vim.fn.has("win32") then 7vim.opt.encoding='utf-8'
8 vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims")) 8vim.opt.inccommand = "nosplit" -- Neovim only: preview substitute and such things in real time
9vim.opt.shadafile = configdir .. "/shada.file"
10
11--------------------------------------------------------------------------------
12-- Bootstrap lazy.nvim
13--------------------------------------------------------------------------------
14local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
15if not (vim.uv or vim.loop).fs_stat(lazypath) then
16 local lazyrepo = "https://github.com/folke/lazy.nvim.git"
17 local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
18 if vim.v.shell_error ~= 0 then
19 vim.api.nvim_echo({
20 { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
21 { out, "WarningMsg" },
22 { "\nPress any key to exit..." },
23 }, true, {})
24 vim.fn.getchar()
25 os.exit(1)
26 end
9end 27end
28vim.opt.rtp:prepend(lazypath)
10 29
11vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") 30require("lazy").setup({
12vim.keymap.set('n', '<F12>', ':Buffers<CR>') 31 spec = {
13 32 { import = "plugins", },
14 33 'coderonline/vim-fancy-line',
15 34 'coderonline/vim-recently-used',
16-- vim.o.shadafile = "/tmp/shada"
17
18-- only on Linux...
19-- vim.o.shadafile = (os.getenv("XDG_CACHE_HOME") or
20-- os.getenv("HOME") .. "/.cache"
21-- ) .. "/vim.shada"
22-- vimscript: get(environ(), "XDG_CACHE_HOME", "~/.cache")."/vim.shada"
23-- require'man'
24
25require'colorizer'.setup()
26
27-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
28require('cmp_nvim_lsp').setup{}
29local capabilities = require('cmp_nvim_lsp').default_capabilities()
30
31
32local cmp = require('cmp');
33cmp.setup({
34 snippet = {
35 -- REQUIRED - you must specify a snippet engine
36 expand = function(args)
37 vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
38 -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
39 -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
40 -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
41 end,
42 },
43 window = {
44 completion = cmp.config.window.bordered(),
45 documentation = cmp.config.window.bordered(),
46 },
47 mapping = cmp.mapping.preset.insert({
48 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
49 ['<C-f>'] = cmp.mapping.scroll_docs(4),
50 ["<Tab>"] = cmp.mapping.select_next_item({behavior=cmp.SelectBehavior.Insert}),
51 ["<S-Tab>"] = cmp.mapping.select_prev_item({behavior=cmp.SelectBehavior.Insert}),
52 ['<C-Space>'] = cmp.mapping.complete(),
53 ['<C-e>'] = cmp.mapping.abort(),
54 -- ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
55
56 ["<CR>"] = cmp.mapping.confirm({
57 behavior = cmp.ConfirmBehavior.Replace,
58 select = true,
59 }),
60
61 ['<C-s>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
62 }),
63 sources = cmp.config.sources({
64 { name = 'nvim_lsp' },
65 { name = 'vsnip' }, -- For vsnip users.
66 -- { name = 'luasnip' }, -- For luasnip users.
67 -- { name = 'ultisnips' }, -- For ultisnips users.
68 -- { name = 'snippy' }, -- For snippy users.
69 }, {
70 { name = 'buffer' },
71 })
72})
73
74-- Set configuration for specific filetype.
75cmp.setup.filetype('gitcommit', {
76 sources = cmp.config.sources({
77 { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
78 }, {
79 { name = 'buffer' },
80 })
81})
82
83-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
84cmp.setup.cmdline({ '/', '?' }, {
85 -- mapping = cmp.mapping.preset.cmdline(),
86 sources = {
87 { name = 'buffer' }
88 } 35 }
89}) 36})
90 37
91-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 38-- Restore cursor position
92cmp.setup.cmdline(':', { 39vim.api.nvim_create_autocmd({ "BufReadPost" }, {
93 -- mapping = cmp.mapping.preset.cmdline(), 40 callback = function() vim.cmd('silent! normal! g`"zv') end
94 sources = cmp.config.sources({
95 { name = 'cmdline' }
96 })
97}) 41})
98 42
43-- LSP says 'fix available', but there is no such command? Let us fix that:
44vim.api.nvim_create_user_command(
45 'LspFix',
46 function()
47 vim.lsp.buf.code_action()
48 end, {}
49)
50
51-- speaking of lsp, lets enable logging (TODO: remove if you remove
52-- `lua/cmp.lua`, but why would you?)
53vim.g.lsp_log_verbose = 1
54vim.g.lsp_log_file = configdir .. ('/vim-lsp.log')
55vim.lsp.set_log_level 'error'
56if vim.fn.has 'nvim-0.5.1' == 1 then
57 require('vim.lsp.log').set_format_func(vim.inspect)
58end
99 59
100-- # Language Servers 60-- If you need scoop for some dependencies on Windows machines this may come
101-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md 61-- handy:
102 62if vim.fn.has("win32") then
103-- The following example advertise capabilities to `clangd`. 63 vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims"))
104-- C/C++ | clang 64end
105require('lspconfig')['clangd'].setup{capabilities = capabilities}
106
107-- bash | bash-language-server
108require('lspconfig')['bashls'].setup{capabilities = capabilities}
109
110-- ccs | vscode-css-languageserver
111require('lspconfig')['cssls'].setup{capabilities = capabilities}
112
113-- rust | rust-analyzer
114require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities}
115
116-- javascript | eslint
117require('lspconfig')['eslint'].setup{capabilities = capabilities}
118
119-- javascript | typescript-language-server
120require('lspconfig')['tsserver'].setup{capabilities = capabilities}
121
122-- vimscript | vim-language-server
123require('lspconfig')['vimls'].setup{capabilities = capabilities}
124
125require('lspconfig')['html'].setup{capabilities = capabilities}
126
127require('lspconfig')['jsonls'].setup{capabilities = capabilities}
128
129-- C/C++ | clang
130require('lspconfig')['clangd'].setup{capabilities = capabilities}
131
132-- bash | bash-language-server
133require('lspconfig')['bashls'].setup{capabilities = capabilities}
134
135-- ccs | vscode-css-languageserver
136require('lspconfig')['cssls'].setup{capabilities = capabilities}
137
138-- rust | rust-analyzer
139require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities}
140
141-- javascript | eslint
142require('lspconfig')['eslint'].setup{capabilities = capabilities}
143
144-- javascript | typescript-language-server
145require('lspconfig')['tsserver'].setup{capabilities = capabilities}
146
147-- vimscript | vim-language-server
148require('lspconfig')['vimls'].setup{capabilities = capabilities}
149
150require('lspconfig')['html'].setup{capabilities = capabilities}
151
152require('lspconfig')['jsonls'].setup{capabilities = capabilities}
153
154require('lspconfig')['pylsp'].setup{
155 settings = {
156 pylsp = {
157 plugins = {
158 pycodestyle = {
159 ignore = {'W391'},
160 maxLineLength = 100
161 }
162 }
163 }
164 }
165}
166
167-- lua
168require('lspconfig')['lua_ls'].setup{
169 settings = {
170 Lua = {
171 diagnostics = {
172 globals = { 'vim', 'require', 'cmp' }
173 }
174 }
175 }
176}
177
178
179require'nvim-treesitter.configs'.setup {
180 -- A list of parser names, or "all"
181 ensure_installed = { "c", "bash", "javascript" },
182
183 -- Install parsers synchronously (only applied to `ensure_installed`)
184 sync_install = false,
185
186 -- Automatically install missing parsers when entering buffer
187 -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
188 auto_install = true,
189
190 -- List of parsers to ignore installing (for "all")
191 ignore_install = { "javascript" },
192
193 ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
194 -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
195
196 highlight = {
197 -- `false` will disable the whole extension
198 enable = true,
199
200 -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
201 -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
202 -- Using this option may slow down your editor, and you may see some duplicate highlights.
203 -- Instead of true it can also be a list of languages
204 additional_vim_regex_highlighting = false,
205 },
206}
207
208-- vim.wo.foldtext = 'v:lua.vim.treesitter.foldtext()' -- not available yet in my installation
209vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
210vim.wo.foldlevel = 1
211 65
66if vim.g.neovide then
67 vim.guifont = "monospace:h11:b"
68 vim.g.neovide_cursor_animation_length = 0.03
69 vim.g.neovide_cursor_trail_size = 0.8
70 vim.g.neovide_scroll_animation_length = 0.05
71 vim.g.neovide_transparency = 0.9
72 vim.g.neovide_cursor_animation_length=0
73 vim.g.neovide_cursor_vfx_mode = ""
74 vim.g.neovide_floating_blur_amount_x = 4.0
75 vim.g.neovide_floating_blur_amount_y = 4.0
76 vim.g.neovide_background_color = '#383a62'
77 vim.g.neovide_scale_factor = 1.0
78end
212 79
213-- vim: tabstop=2 shiftwidth=2 softtabstop=2 80-- vim: tabstop=2 shiftwidth=2 softtabstop=2
diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua
new file mode 100644
index 0000000..1eb9646
--- /dev/null
+++ b/lua/plugins/cmp.lua
@@ -0,0 +1,157 @@
1return {
2 {
3 'hrsh7th/nvim-cmp',
4 dependencies = {
5 'nvim-lua/popup.nvim',
6 'nvim-lua/plenary.nvim',
7 'saadparwaiz1/cmp_luasnip',
8 "hrsh7th/cmp-emoji",
9 'hrsh7th/cmp-nvim-lsp',
10 'hrsh7th/cmp-buffer',
11 'hrsh7th/cmp-path',
12 'hrsh7th/vim-vsnip',
13 'octaltree/cmp-look',
14 'folke/trouble.nvim',
15 {
16 'L3MON4D3/LuaSnip',
17 config = function()
18 vim.keymap.set(
19 {"i", "s"},
20 "<leader><Tab>",
21 function() require('luasnip').jump(1) end,
22 {silent = true}
23 )
24 vim.keymap.set(
25 {"i", "s"},
26 "<leader><S-Tab>",
27 function() require('luasnip').jump(-1) end,
28 {silent = true}
29 )
30 end,
31 },
32 },
33
34 config = function()
35 require('trouble').setup()
36
37 local cmp = require'cmp'
38 cmp.setup({
39 snippet = {
40 -- REQUIRED - you must specify a snippet engine
41 expand = function(args)
42 require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
43 -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
44 end,
45 },
46 window = {
47 completion = cmp.config.window.bordered(),
48 documentation = cmp.config.window.bordered(),
49 },
50 mapping = cmp.mapping.preset.insert({
51 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
52 ['<C-f>'] = cmp.mapping.scroll_docs(4),
53 ['<C-Space>'] = cmp.mapping.complete(),
54 ['<C-e>'] = cmp.mapping.abort(),
55 ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
56 }),
57 sources = cmp.config.sources({
58 { name = 'nvim_lsp' },
59 { name = 'luasnip' }, -- For luasnip users.
60 }, {
61 { name = 'buffer' },
62 })
63 })
64 end
65 },
66 {
67 'neovim/nvim-lspconfig',
68 dependencies = {
69 { "folke/neodev.nvim" }
70 },
71 config = function()
72 -- Set up lspconfig.
73 local keymap = vim.keymap
74 local on_attach = function(client, bufnr)
75 local opts = { noremap = true, silent = true, buffer = bufnr }
76 keymap.set("n", "gf", "<cmd>Lspsaga lsp_finder<CR>", opts) -- show definition, references
77 keymap.set("n", "gD", "<Cmd>Lspsaga goto_definition<CR>", opts) -- got to declaration
78 keymap.set("n", "gd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
79 keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation
80 keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions
81 keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
82 keymap.set("n", "<leader>D", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
83 keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor
84 keymap.set("n", "[d", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opts) -- jump to previous diagnostic in buffer
85 keymap.set("n", "]d", "<cmd>Lspsaga diagnostic_jump_next<CR>", opts) -- jump to next diagnostic in buffer
86 keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
87 keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side
88 keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
89 vim.keymap.set("n", "<C-n>", ":cnext<CR>")
90 vim.keymap.set("n", "<C-p>", ":cprev<CR>")
91 end
92
93 local capabilities = require("cmp_nvim_lsp").default_capabilities()
94
95 -- # Language Servers
96 -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
97 for _,server in ipairs({
98 'bitbake_language_server',
99 "clangd", -- C/C++ | clang
100 "ts_ls", -- javascript | typescript-language-server
101 "lua_ls", -- lua (but not init.lua entirely, hence why neodev)
102 "jdtls",
103 "html",
104 "cssls", -- ccs | vscode-css-languageserver
105 "rust_analyzer", -- rust | rust-analyzer
106 "eslint", -- javascript | eslint
107 'vimls', -- vimscript | vim-language-server
108 'html', -- html
109 'jsonls', -- jsonls
110 "pyright", -- python
111 "bashls", -- bash | bash-language-server
112 "gopls",
113 "emmet_ls",
114 "marksman"}) do
115 require("lspconfig")[server].setup({
116 capabilities = capabilities,
117 on_attach = on_attach
118 })
119 end
120
121 -- # specialized config for some LSPs which have non-ideal defaults
122 --
123 -- require('lspconfig')['java_language_server'].setup{ cmd = { "/usr/share/java/java-language-server/lang_server_linux.sh" }, root_dir = function () return vim.fn.getcwd() end }
124 -- configure html server
125 require('lspconfig')["html"].setup({
126 init_options = {
127 configurationSection = { "html", "css", "javascript" },
128 embeddedLanguages = {
129 css = true,
130 javascript = true,
131 },
132 provideFormatter = true,
133 },
134 })
135 require('lspconfig')['pylsp'].setup{
136 settings = {
137 pylsp = {
138 plugins = {
139 pycodestyle = {
140 ignore = {'W391'},
141 maxLineLength = 100
142 }
143 }
144 }
145 }
146 }
147 require("lspconfig").clangd.setup {
148 on_attach = on_attach,
149 capabilities = capabilities,
150 cmd = {
151 "clangd",
152 "--offset-encoding=utf-16",
153 },
154 }
155 end
156 }
157}
diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua
new file mode 100644
index 0000000..416f2d1
--- /dev/null
+++ b/lua/plugins/colorizer.lua
@@ -0,0 +1,6 @@
1return {
2 'norcalli/nvim-colorizer.lua',
3 config = function()
4 require('colorizer').setup()
5 end,
6}
diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua
new file mode 100644
index 0000000..a73b1e8
--- /dev/null
+++ b/lua/plugins/colorscheme.lua
@@ -0,0 +1,6 @@
1return {
2 'RRethy/base16-nvim',
3 config = function()
4 vim.cmd.colorscheme "base16-rebecca"
5 end,
6}
diff --git a/lua/plugins/devicons.lua b/lua/plugins/devicons.lua
new file mode 100644
index 0000000..9e69c5f
--- /dev/null
+++ b/lua/plugins/devicons.lua
@@ -0,0 +1,11 @@
1
2return {
3 'nvim-tree/nvim-web-devicons',
4 config = function()
5 require'nvim-web-devicons'.setup {
6 color_icons = true;
7 default = true;
8 strict = true;
9 }
10 end,
11}
diff --git a/lua/plugins/fzf.lua b/lua/plugins/fzf.lua
new file mode 100644
index 0000000..f3fc76b
--- /dev/null
+++ b/lua/plugins/fzf.lua
@@ -0,0 +1,4 @@
1return {
2 'junegunn/fzf',
3 'junegunn/fzf.vim',
4}
diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua
new file mode 100644
index 0000000..d88bf68
--- /dev/null
+++ b/lua/plugins/gitsigns.lua
@@ -0,0 +1,6 @@
1return {
2 'lewis6991/gitsigns.nvim',
3 config = function()
4 require('gitsigns').setup()
5 end,
6}
diff --git a/lua/plugins/lspsaga.lua b/lua/plugins/lspsaga.lua
new file mode 100644
index 0000000..ff7867b
--- /dev/null
+++ b/lua/plugins/lspsaga.lua
@@ -0,0 +1,10 @@
1return {
2 'nvimdev/lspsaga.nvim',
3 config = function()
4 require('lspsaga').setup({})
5 end,
6 dependencies = {
7 'nvim-treesitter/nvim-treesitter', -- optional
8 'nvim-tree/nvim-web-devicons', -- optional
9 }
10}
diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua
new file mode 100644
index 0000000..a9d6ea0
--- /dev/null
+++ b/lua/plugins/orgmode.lua
@@ -0,0 +1,11 @@
1return {
2 'nvim-orgmode/orgmode',
3 event = 'VeryLazy',
4 ft = { 'org' },
5 config = function()
6 require('orgmode').setup({
7 org_agenda_files = '~/orgfiles/**/*',
8 org_default_notes_file = '~/orgfiles/refile.org',
9 })
10 end,
11}
diff --git a/lua/plugins/popup.lua b/lua/plugins/popup.lua
new file mode 100644
index 0000000..0ff2e3a
--- /dev/null
+++ b/lua/plugins/popup.lua
@@ -0,0 +1,5 @@
1return {
2 'nvim-lua/plenary.nvim',
3 'nvim-lua/popup.nvim',
4}
5
diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua
new file mode 100644
index 0000000..fee09df
--- /dev/null
+++ b/lua/plugins/telescope.lua
@@ -0,0 +1,15 @@
1return {
2 'nvim-telescope/telescope.nvim',
3 dependencies = {
4 'nvim-telescope/telescope-media-files.nvim'
5 },
6 config = function()
7 require('telescope').load_extension('media_files')
8
9 local builtin = require('telescope.builtin')
10 vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
11 vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
12 vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
13 vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
14 end,
15}
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..9673f63
--- /dev/null
+++ b/lua/plugins/treesitter.lua
@@ -0,0 +1,20 @@
1return {
2 -- treesitter is experimental and breaks indentation on xml, html with `=`
3 -- treesitter is optional for orgmode, but without it syntax highlighting in
4 -- org files is broken
5 'nvim-treesitter/nvim-treesitter',
6 config = function()
7 require'nvim-treesitter.configs'.setup {
8 ensure_installed = {"c", "html", "css", "javascript", "org"},
9 sync_install = false,
10 auto_install = true,
11 ignore_install = {},
12 disable = { },
13 modules = { "all" },
14 highlight = {
15 enable = true,
16 }
17 }
18 end
19}
20
diff --git a/pack/all/start/fzf b/pack/all/start/fzf
deleted file mode 160000
Subproject 70c461c60bb1e2165a378e8ba0451b511c29b5c
diff --git a/pack/all/start/fzf.vim b/pack/all/start/fzf.vim
deleted file mode 160000
Subproject d1016dbd7cec2d2a3bb5863776c84b4034e4b85
diff --git a/pack/all/start/vim-colorscheme-papercolor b/pack/all/start/vim-colorscheme-papercolor
deleted file mode 160000
Subproject 9051480ad9129ff4ab4fffb38b44779b9081626
diff --git a/pack/all/start/vim-editorconfig b/pack/all/start/vim-editorconfig
deleted file mode 160000
Subproject e014708e917b457e8f6c57f357d55dd3826880d
diff --git a/pack/all/start/vim-fancy-line b/pack/all/start/vim-fancy-line
deleted file mode 160000
Subproject 6bef9966d5f15203c1567516a5da49b72121423
diff --git a/pack/all/start/vim-karlmarks b/pack/all/start/vim-karlmarks
deleted file mode 160000
Subproject 9747ae42e4201b0991152d45a604b81c01d3e81
diff --git a/pack/all/start/vim-mercenary b/pack/all/start/vim-mercenary
deleted file mode 160000
Subproject 7e57581a60aec3bbc6499b4f49b3eca3b71caed
diff --git a/pack/all/start/vim-recently-used b/pack/all/start/vim-recently-used
deleted file mode 160000
Subproject 7845fa4e392e8808693096329bf3638e3231186
diff --git a/pack/all/start/vim-under-the-cursor b/pack/all/start/vim-under-the-cursor
deleted file mode 160000
Subproject f8a3dfbdf3b0b9d0eb18423115744f42660750f
diff --git a/pack/nvim/start/nvim-cmp b/pack/nvim/start/nvim-cmp
deleted file mode 160000
Subproject d3a3056204e1a9dbb7c7fe36c114dc43b681768
diff --git a/pack/nvim/start/nvim-cmp-buffer b/pack/nvim/start/nvim-cmp-buffer
deleted file mode 160000
Subproject 3022dbc9166796b644a841a02de8dd1cc1d311f
diff --git a/pack/nvim/start/nvim-cmp-lsp-signature-help b/pack/nvim/start/nvim-cmp-lsp-signature-help
deleted file mode 160000
Subproject 3d8912ebeb56e5ae08ef0906e3a54de1c66b92f
diff --git a/pack/nvim/start/nvim-cmp-nvim-lsp b/pack/nvim/start/nvim-cmp-nvim-lsp
deleted file mode 160000
Subproject 44b16d11215dce86f253ce0c30949813c0a9076
diff --git a/pack/nvim/start/nvim-colorizer b/pack/nvim/start/nvim-colorizer
deleted file mode 160000
Subproject 36c610a9717cc9ec426a07c8e6bf3b3abcb139d
diff --git a/pack/nvim/start/nvim-lsp b/pack/nvim/start/nvim-lsp
deleted file mode 160000
Subproject c58edb98f09a650612adaaf8c47995c9e2b7ffb
diff --git a/pack/nvim/start/nvim-lspconfig b/pack/nvim/start/nvim-lspconfig
deleted file mode 160000
Subproject 38da5bbe1eaab2394056109e48c7e195bdb8fdf
diff --git a/pack/nvim/start/nvim-lua-language-server b/pack/nvim/start/nvim-lua-language-server
deleted file mode 160000
Subproject ce964793afc6251673238c256a25e06502e487b
diff --git a/pack/nvim/start/nvim-plenary b/pack/nvim/start/nvim-plenary
deleted file mode 160000
Subproject 50012918b2fc8357b87cff2a7f7f0446e47da17
diff --git a/pack/nvim/start/nvim-telescope b/pack/nvim/start/nvim-telescope
deleted file mode 160000
Subproject 74ce793a60759e3db0d265174f137fb62743035
diff --git a/pack/nvim/start/nvim-treesitter b/pack/nvim/start/nvim-treesitter
deleted file mode 160000
Subproject 4a68f0778c05083cc458a3a144205cfc4147443
diff --git a/pack/nvim/start/nvim-vsnip b/pack/nvim/start/nvim-vsnip
deleted file mode 160000
Subproject be277461265f1e5c7db470aa479f30956597ea9
diff --git a/pack/vim/opt/vim-youcompleteme b/pack/vim/opt/vim-youcompleteme
deleted file mode 160000
Subproject cc9a3ae3efdcc7d038aab0620ea28882533c236
diff --git a/plugin/lsp.nvim b/plugin/lsp.nvim
deleted file mode 100644
index 979b35f..0000000
--- a/plugin/lsp.nvim
+++ /dev/null
@@ -1 +0,0 @@
1command! LspFix lua vim.lsp.buf.code_action()
diff --git a/plugin/max-find-bash.vim b/plugin/max-find-bash.vim
deleted file mode 100644
index 29cb7c3..0000000
--- a/plugin/max-find-bash.vim
+++ /dev/null
@@ -1,11 +0,0 @@
1"=======================================================================================================================
2" SHELL:
3" Many scripts rely on bash. We help to find the bash binary
4"=======================================================================================================================
5if filereadable("/bin/bash")
6 set shell=/bin/bash
7elseif filereadable("/usr/local/bin/bash")
8 set shell=/usr/local/bin/bash
9elseif has("win32")
10 set shell = 'cmd.exe'
11endif
diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim
deleted file mode 100644
index 9d0c034..0000000
--- a/plugin/max-fix-colorschemes.vim
+++ /dev/null
@@ -1,62 +0,0 @@
1"=======================================================================================================================
2" COLOR SCHEME:
3"=======================================================================================================================
4function! ExtendColorTheme()
5 highlight! Bold cterm=bold gui=bold
6 highlight! Italic cterm=italic gui=italic
7 highlight! Underline cterm=underline gui=underline
8 highlight! BoldUnderline cterm=bold,underline gui=bold,underline
9 highlight! BoldItalic cterm=bold,Italic gui=bold,italic
10 highlight! Todo cterm=bold gui=bold guibg=#ffffaa guifg=#000000
11 highlight! Error cterm=NONE ctermbg=NONE gui=NONE guibg=NONE
12 highlight! SpellBad cterm=NONE gui=undercurl guibg=NONE guifg=red
13 highlight! Ignore cterm=NONE ctermbg=NONE ctermfg=NONE gui=NONE guibg=NONE guifg=NONE
14 highlight! LineNr cterm=italic gui=italic
15 highlight! PmenuThumb cterm=inverse
16 highlight! MoreMsg cterm=inverse
17
18 highlight! link qfSeparator Normal | " reserve one space
19 highlight! link qfLineNr Normal | " informational line numbers should look different
20 highlight! link SpecialKey NonText | " makes tab stop (see listchars) less disturbing
21 highlight! link WildMenu Search
22 highlight! link Convention Error
23 highlight! link PmenuSbar Pmenu
24 highlight! link VertSplit LineNr
25 highlight! link SignColumn LineNr
26 highlight! link ALEErrorSign LineNr
27 highlight! link FoldColumn VertSplit
28 highlight! link Folded LineNr
29 highlight! link EndOfBuffer NonText
30 highlight! link DiagnosticHint Debug
31 highlight! link DiagnosticInfo Debug
32 highlight! link DiagnosticError Error
33 highlight! link DiagnosticWarn Debug
34
35
36 hi Comment gui=italic
37 hi Keyword gui=bold
38
39 autocmd BufReadPost * syntax match Convention /\s*$/
40endfunction
41autocmd ColorScheme * call ExtendColorTheme()
42
43if &term == "linux"
44 set notermguicolors
45else
46 set termguicolors
47endif
48
49
50let g:PaperColor_Theme_Options = {
51 \ 'theme': {
52 \ 'default.dark': {
53 \ 'transparent_background': 1
54 \ },
55 \ 'default.light': {
56 \ 'transparent_background': 1
57 \ }
58 \ }
59 \ }
60
61set background=dark
62colorscheme PaperColor
diff --git a/plugin/max-set-window-title.vim b/plugin/max-set-window-title.vim
deleted file mode 100644
index 1838f03..0000000
--- a/plugin/max-set-window-title.vim
+++ /dev/null
@@ -1,22 +0,0 @@
1
2
3augroup SET_WINDOW_TITLE
4 set title
5 set titlelen=40
6
7 " set window title for screen(3)
8 " if &term == "screen" || &term == "xterm"
9 if &term == "screen"
10 set t_ts=k
11 set t_fs=\
12 endif
13
14 " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]"
15 " autocmd CursorHold * let &titlestring = "%t %y ".$USER."@".hostname().":%{expand("%:~:.:h")}"
16 set titlestring=\ %F
17 " Fix terminal title =================================================================================================
18 " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q"
19 " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7"
20 autocmd VimLeave * silent !echo -ne "\033]112\007"
21augroup END
22
diff --git a/plugin/netrw.vim b/plugin/netrw.vim
deleted file mode 100644
index 57d6d50..0000000
--- a/plugin/netrw.vim
+++ /dev/null
@@ -1,16 +0,0 @@
1augroup NETRW
2 " Deprecated with this configuration, but still useful when deactivating some Plugins
3 " NETRW: obsolete with NERDTree
4 let g:netrw_alto = 0 | " open files on the right
5 let g:netrw_altv = 1 | " open files on the right
6 let g:netrw_banner = 0 | " display help messages?
7 let g:netrw_browse_split = 4 | " 4=open in previous window
8 let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors)
9 let g:netrw_hide = 1 | " show not-hidden files only
10 let g:netrw_keepdir = 1 | " because that works better, when gf finds a path name
11 let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot
12 let g:netrw_liststyle = 3 | " 3=tree
13 let g:netrw_preview = 0 | "
14 let g:netrw_winsize = 20 | " window size in percent
15 " let s:treedepthstring = "│ " | " this is not going to work, but left here for documentation
16augroup END
diff --git a/plugin/vimdiff.vim b/plugin/vimdiff.vim
deleted file mode 100644
index ffd9f46..0000000
--- a/plugin/vimdiff.vim
+++ /dev/null
@@ -1,4 +0,0 @@
1if &diff " only for diff mode/vimdiff
2 set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync
3 set foldmethod=syntax
4endif
diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim
deleted file mode 100644
index a241dae..0000000
--- a/plugin/youcompleteme.vim
+++ /dev/null
@@ -1,21 +0,0 @@
1augroup YOUCOMPLETEME
2 let g:ycm_error_symbol = '✖' " insert this as an error symbol in the gutter bar/sign column
3 let g:ycm_warning_symbol = '➔' " insert this as a warning symbol in the gutter bar/sign coloumn
4
5 let g:ycm_autoclose_preview_window_after_insertion = 0
6 let g:ycm_auto_trigger = 1
7 let g:ycm_collect_identifiers_from_tags_files = 0 " Let YCM read tags from Ctags file
8 let g:ycm_confirm_extra_conf = 0 " security is overrated ;)
9 let g:ycm_always_populate_location_list = 0 " we can manually run :YcmDiags to do that
10
11 let g:ycm_key_list_previous_completion = ['Up']
12 let g:ycm_key_list_select_completion = ['Down']
13
14 "" let g:ycm_semantic_triggers =
15 "" \ {
16 "" \ 'c': [ 're!\w{2}' ]
17 "" \ } " per language configurations
18 " packadd YouCompleteMe
19augroup END
20
21
diff --git a/utils/Xresources b/utils/Xresources
deleted file mode 100644
index 08969ac..0000000
--- a/utils/Xresources
+++ /dev/null
@@ -1,192 +0,0 @@
1#include "/home/max/.local/share/base16/base16-xresources/xresources/base16-tomorrow-night.Xresources"
2! #include "/home/max/.local/share/base16/base16-xresources/xresources/base16-tomorrow.Xresources"
3
4urxvt.scrollBar: false
5urxvt.background: base00
6urxvt.color0: base00
7urxvt.color1: base00
8urxvt.color2: base00
9urxvt.color3: base00
10urxvt.color4: base00
11urxvt.color5: base00
12urxvt.color6: base00
13urxvt.color7: base00
14urxvt.color8: base00
15urxvt.color9: base00
16
17! *Dialog.foreground: foreground
18! *Dialog.background: base00
19! *Dialog.Button.foreground: base05
20! *Dialog.Button.background: base00
21! !*Dialog.Button.pointBackground: #EAEAEA
22! !*Dialog.Button.clickBackground: #C3C3C3
23! *Dialog.text.foreground: base02
24! *Dialog.text.background: base00
25! *Dialog.topShadowColor: base03
26! *Dialog.bottomShadowColor: base04
27
28xscreensaver.logFile:/home/max/xscreensaver.log
29xscreensaver.verbose:true
30*.newLoginCommand: xset dpms force off
31
32Xft.antialias: true
33Xft.lcdfilter: lcddefault
34Xft.hinting: true
35Xft.rgba: rgb
36Xft.hintstyle: hintfull
37Xft.dpi: 96
38
39!*passwd.passwdFont: *-helvetica-medium-r-*-*-*-140-*-*-*-iso8859-1
40!*passwd.passwdFont:
41
42!*font: -*-clean-medium-r-*--12-*-*-*-*-*-*-*
43!*font: xft:Bitstream Vera Sans Mono-8
44!*font: *-dejavu sans-bold-r-*-*-*-*-*-*-*-*-*-*
45!*font: *-monospace-bold-r-*-*-*-*-*-*-*-*-*-*
46!*.font: xft:monaco:bold:size=8
47!*.font: xft:RobotoMono Nerd Font:bold:size=10
48*.passwdFont: xft:monospace
49*.font: xft:monospace
50
51
52xscreensaver.overlayTextForeground: #FFFF00
53xscreensaver.overlayTextBackground: #000000
54
55
56*passwd.thermometer.foreground: #FF0000
57*passwd.thermometer.background: #FFFFFF
58
59*passwd.heading.label: XScreenSaver %s
60*passwd.body.label: This screen is fucked.
61*passwd.unlock.label: unfuck
62*passwd.login.label: dpms: off
63*passwd.user.label: User:
64*passwd.thermometer.width: 12
65*passwd.asterisks: True
66*passwd.uname: False
67
68
69XLock*mode: image
70*image.bitmap: /home/max/.lock.xpm
71*image.count: 1
72*image.erasedelay: 0
73XLock*erasedelay: 0
74XLock*icongeometry: 180x180
75! XLock*background: background
76! XLock*foreground: foreground
77XLock*description: off
78XLock*info:
79
80
81
82
83! ---=== Experiment with making Motif less ugly for DDD ===---
84! (DDD ignores generically-set Motif properties so we must do this)
85! TODO (if possible):
86! - Hide text cursors in unfocused fields
87! - Convert on-hover effect from shadow to background color or border
88! - Pick better fonts and check which package provides them
89
90! Use the lighter background grey from the Lubuntu GTK+ theme
91! (Still a cool grey. Eyedropper the Clearlooks warm grey if necessary.)
92Ddd*background: #e0e0e0
93
94! These had no effect on my system but, from what I read, they help on
95! some systems.
96Ddd*enableThinThickness: True
97Ddd*enableEtchedInMenu: True
98Ddd*enableToggleColor: True
99Ddd*enableToggleVisual: True
100
101! Use pure white for white backgrounds like modern widget themes and websites
102Ddd*XmText.background: #ffffff
103Ddd*XmTextField.background: #ffffff
104Ddd*XmList.background: #ffffff
105Ddd*GraphEdit.background: #ffffff
106
107! Thick borders and shadows everywhere are archaic
108Ddd*shadowThickness: 1
109Ddd*borderThickness: 0
110Ddd*?*arg*shadowThickness: 1
111Ddd*?*arg*borderThickness: 0
112Ddd*?*buttons*shadowThickness: 1
113Ddd*?*buttons*borderThickness: 0
114
115! Un-cramp the menubar, menus, and toolbar to match modern compact sizing
116Ddd*menubar*marginTop: 1
117Ddd*menubar*marginBottom: 0
118Ddd*XmMenuShell*marginTop: 2
119Ddd*XmMenuShell*marginBottom: 2
120Ddd*XmMenuShell.?.marginWidth: 2
121Ddd*XmMenuShell.?.marginHeight: 2
122Ddd*toolbar*marginWidth: 5
123
124! Compact the menu tear-off buttons
125Ddd*XmMenuShell*XmTearOffButton*borderWidth: 0
126Ddd*XmMenuShell*XmTearOffButton*marginHeight: 0
127
128! DDD's interpretation of a "toggle button" shouldn't have a raised border
129Ddd*XmToggleButton*shadowThickness: 0
130Ddd*XmToggleButton*borderThickness: 0
131
132! The menu bar should not have a raised border
133Ddd*menubar.shadowThickness: 0
134Ddd*menubar.borderThickness: 0
135Ddd*XmMenuShell*XmTearOffButton*ShadowThickness: 2
136
137! ...and we do not want a border around the toolbar to make that stand out
138Ddd*main_window.?.borderThickness: 0
139Ddd*main_window.shadowThickness: 0
140
141! Drop-down boxes in toolbars do not have raised borders these days
142Ddd*toolbar.shadowThickness: 0
143Ddd*toolbar.?.shadowThickness: 1
144
145! DDD can sometimes get its GDB settings fatally messed up so duplicate
146! GUI-exposed integration defaults here for when I want to nuke ~/.ddd/init
147Ddd*cutCopyPasteBindings: KDE
148Ddd*selectAllBindings: KDE
149Ddd*buttonColorKey: c
150Ddd*FlatButtons: on
151
152
153! Good Xaw3d Defaults*customization: -color
154*shadowWidth: 3
155*Form.background: gray75
156*MenuButton.background: gray75
157*SimpleMenu.background: gray70
158*TransientShell*Dialog.background: gray70
159*Command.background: gray75
160*Label.background: gray75
161*ScrollbarBackground: grey39
162*Scrollbar*background: gray75
163*Scrollbar*width: 15
164*Scrollbar*height: 15
165*Scrollbar*shadowWidth: 2
166*Scrollbar*cursorName: top_left_arrow
167*Scrollbar*pushThumb: false
168*shapeStyle: Rectangle
169*beNiceToColormap: False
170*SmeBSB*shadowWidth: 3
171*highlightThickness: 0
172*topShadowContrast: 40
173*bottomShadowContrast: 60
174! fix up a few of the default X clients who
175! now look silly
176*xclock*shadowWidth: 0
177*xload*shadowWidth: 0
178*xcalc*shadowWidth: 0
179
180
181XTerm.vt100.faceName: Monospace:antialias=true
182XTerm.vt100.faceSize: 12
183! XTerm.vt100.font: 7x14
184XTerm.vt100.locale: true
185XTerm.vt100.utf8Title: true
186
187
188! keepassx colourscheme
189keepassx*background: #cfcfcf
190keepassx*foreground: #222222
191keepassx2*background: #cfcfcf
192keepassx2*foreground: #222222
diff --git a/utils/applications/gvim-buffer.desktop b/utils/applications/gvim-buffer.desktop
deleted file mode 100644
index 5cd2cbf..0000000
--- a/utils/applications/gvim-buffer.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
1[Desktop Entry]
2Type=Application
3Name=Gnome Vi IMproved Buffer
4Icon=gvim
5Comment=Open file in an existing instance of vi and in a new tab
6MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
7Exec=gvim -f -N --remote-silent %F
8Terminal=false
9X-XClassHintResName=VIM
10Categories=Utility;TextEditor;
diff --git a/utils/applications/gvim.desktop b/utils/applications/gvim.desktop
deleted file mode 100644
index 37c6e58..0000000
--- a/utils/applications/gvim.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
1[Desktop Entry]
2Name=Vi IMproved Tab
3Comment=Open file in an existing instance of vi and in a new tab
4MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
5Exec=gvim f -N --remote-tab %F
6Icon=gvim
7Type=Application
8Terminal=false
9X-XClassHintResName=VIM
10Categories=Utility;TextEditor;
diff --git a/utils/applications/nvim.desktop b/utils/applications/nvim.desktop
deleted file mode 100644
index 21f0090..0000000
--- a/utils/applications/nvim.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
1[Desktop Entry]
2Version=1.0
3Type=Application
4Name=Vim
5Comment=
6Exec=xfce4-terminal --icon /usr/share/icons/HighContrast/256x256/apps/vim.png -T 'nvim' -e '/bin/bash -i -c "env TERM=gnome-256color screen nvr ."' --fullscreen
7Icon=/usr/share/icons/HighContrast/256x256/apps/vim.png
8Path=
9Terminal=false
10StartupNotify=false
diff --git a/utils/applications/vim.desktop b/utils/applications/vim.desktop
deleted file mode 100755
index 8169f57..0000000
--- a/utils/applications/vim.desktop
+++ /dev/null
@@ -1,15 +0,0 @@
1[Desktop Entry]
2Version=1.0
3Type=Application
4Name=Vi IMproved
5Comment=Open file in an existing instance of vi and in a new tab
6Icon=gvim
7MimeType=text/*
8Categories=Application;Utility;TextEditor;
9Exec=vim %F
10Terminal=true
11Actions=Server;
12
13[Desktop Action Server]
14Exec=vim --servername VIM --remote-silent %F
15Name=Browse in Server
diff --git a/utils/bashrc b/utils/bashrc
deleted file mode 100644
index f0ee98b..0000000
--- a/utils/bashrc
+++ /dev/null
@@ -1,46 +0,0 @@
1
2# gvim () { /bin/gvim $(if [[ "$#" > 0 && `/bin/gvim --serverlist | wc -l` ]]; then echo --remote; fi) $@; }
3# vim () { /bin/vim $(if [[ "$#" > 0 && `/bin/vim --serverlist | wc -l` ]]; then echo --remote; fi) $@; }
4
5# man()
6# {
7# /bin/gvim \
8# $(if [[ `/bin/gvim --serverlist | wc -l` > 0 ]]; then echo --remote-send; fi) \
9# ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg";
10# }
11
12# export MANPAGER='vim -c":set noswapfile|%!col -b" -c":file man|:setlocal filetype=man buftype=nowrite readonly nonumber nolist signcolumn=no" -'
13export MANPAGER="vim -M +MANPAGER -"
14
15# man() { /bin/vim ":enew<CR>:0read !groffer --pager='cat' --tty $1 <bar> col -bx<CR> :set filetype=man buftype=nowrite readonly<CR>gg" -; }
16# alias git='git -c color.ui=false'
17# export GIT_DIFF_OPTS="--no-color"
18
19
20
21git config --global --replace-all color.pager 0
22git config --global --replace-all core.pager 'vim -c":set noswapfile filetype=git buftype=nowrite readonly nolist nonumber signcolumn=no|:file git" -'
23# export GIT_PAGER=''
24
25# alias git="TERM=dumb git"
26
27# export EDITOR="gvim()"
28# export PAGER="tee /tmp/output.txt /dev/stdout | /bin/vim -"
29
30# --remote-expr ":%!col -b" -c":set buftype=nowrite filetype=man readonly" -'A
31
32function vim() {
33 SERVER=$(ls -tr "$XDG_RUNTIME_DIR"/nvim.* | tail -n1)
34 if [ $# -gt 0 ] && [ -n "$SERVER" ]; then
35 for i in "$@"; do
36 NEXT=$(realpath "$i")
37 nvim --server "$SERVER" --remote-silent "$NEXT"
38 done
39 else
40 nvim $@
41 fi
42
43}
44
45
46
diff --git a/utils/default-font.conf b/utils/default-font.conf
deleted file mode 100644
index f905783..0000000
--- a/utils/default-font.conf
+++ /dev/null
@@ -1,82 +0,0 @@
1<?xml version="1.0"?>
2<!-- this is a configuration file for fontconfig and should be copied or linked to ~/.config/fontconfig/fonts.conf -->
3<!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd">
4<fontconfig>
5 <match target="pattern">
6 <test name="family"><string>monospace</string></test>
7 <edit name="family" mode="prepend">
8 <!--<string>Iosevka Term SS04</string>-->
9 <string>FuraCode Nerd Font Mono Medium</string>
10 <string>FiraCode Nerd Font</string>
11 <string>FuraCode Nerd Font</string>
12 <string>Noto Color Emoji</string>
13 </edit>
14 <edit name="fontfeatures" mode="append">
15 <string>liga on</string>
16 <string>dlig on</string>
17 </edit>
18 <test name="slant" compare="not_eq"><const>italic</const></test>
19 <edit mode="assign" name="style"><string>bold</string></edit>
20 </match>
21 <!-- Block Symbola from the list of fallback fonts. -->
22 <selectfont>
23 <rejectfont>
24 <pattern>
25 <patelt name="family">
26 <string>Symbola</string>
27 </patelt>
28 </pattern>
29 </rejectfont>
30 </selectfont>
31 <match target="pattern">
32 <test name="family"><string>serif</string></test>
33 <edit name="family" mode="prepend">
34 <string>Noto Serif</string>
35 </edit>
36 </match>
37 <match target="pattern">
38 <test name="family"><string>sans-serif</string></test>
39 <edit name="family" mode="prepend">
40 <string>Noto Sans</string>
41 </edit>
42 </match>
43 <match target="pattern">
44 <edit name="dpi" mode="assign"><double>102</double></edit>
45 </match>
46
47 <match target="pattern">
48 <test name="family">
49 <string>Tahoma</string>
50 </test>
51 <edit name="family" mode="assign">
52 <string>Sans-Serif</string>
53 </edit>
54 </match>
55</fontconfig>
56 <!--
57 family: "Anonymous Pro for Powerline"(s)
58 family: "Consolas for Powerline"(s) "Consolas for Powerline FixedD"(s)
59 family: "DejaVu Sans Mono for Powerline"(s)
60 family: "Droid Sans Mono for Powerline"(s)
61 family: "Inconsolata for Powerline"(s)
62 family: "Inconsolata-dz for Powerline"(s)
63 family: "Liberation Mono for Powerline"(s)
64 family: "Menlo for Powerline"(s)
65 family: "Meslo LG L DZ for Powerline"(s)
66 family: "Meslo LG L for Powerline"(s)
67 family: "Meslo LG M DZ for Powerline"(s)
68 family: "Meslo LG M for Powerline"(s)
69 family: "Meslo LG S DZ for Powerline"(s)
70 family: "Meslo LG S for Powerline"(s)
71 family: "PowerlineSymbols"(s)
72 family: "Source Code Pro for Powerline"(s)
73 family: "Source Code Pro for Powerline"(s) "Source Code Pro Black"(s)
74 family: "Source Code Pro for Powerline"(s) "Source Code Pro ExtraLight"(s)
75 family: "Source Code Pro for Powerline"(s) "Source Code Pro Light"(s)
76 family: "Source Code Pro for Powerline"(s) "Source Code Pro Medium"(s)
77 family: "Source Code Pro for Powerline"(s) "Source Code Pro Semibold"(s)
78 family: "Terminus for Powerline"(s)
79 family: "Ubuntu Mono derivative Powerline"(s)
80 family: "xos4 Terminess Powerline"(s)
81 family: "xos4 Terminus for Powerline"(s)
82 -->
diff --git a/utils/default-font.conf.old b/utils/default-font.conf.old
deleted file mode 100644
index ec2e12e..0000000
--- a/utils/default-font.conf.old
+++ /dev/null
@@ -1,49 +0,0 @@
1<?xml version="1.0"?>
2<!-- this is a configuration file for fontconfig and should be copied or linked to ~/.config/fontconfig/conf.d/ -->
3<!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd">
4<fontconfig>
5 <match target="pattern">
6 <test qual="any" name="family"><string>serif</string></test>
7 <edit name="family" mode="assign" binding="same"><string>Noto Serif</string></edit>
8 </match>
9 <match target="pattern">
10 <test qual="any" name="family"><string>sans-serif</string></test>
11 <edit name="family" mode="assign" binding="same"><string>Noto Sans</string></edit>
12 </match>
13 <match target="pattern">
14 <test qual="any" name="family"><string>monospace</string></test>
15 <edit mode="assign" name="family"><string>Hack</string></edit>
16 <edit mode="prepend" name="family"><string>Noto Color Emoji</string></edit>
17 <edit mode="prepend" name="family"><string>emoji</string></edit>
18
19 <test name="slant" compare="not_eq"><const>italic</const></test>
20 <edit mode="assign" name="style"><string>bold</string></edit>
21 </match>
22</fontconfig>
23 <!--
24 family: "Anonymous Pro for Powerline"(s)
25 family: "Consolas for Powerline"(s) "Consolas for Powerline FixedD"(s)
26 family: "DejaVu Sans Mono for Powerline"(s)
27 family: "Droid Sans Mono for Powerline"(s)
28 family: "Inconsolata for Powerline"(s)
29 family: "Inconsolata-dz for Powerline"(s)
30 family: "Liberation Mono for Powerline"(s)
31 family: "Menlo for Powerline"(s)
32 family: "Meslo LG L DZ for Powerline"(s)
33 family: "Meslo LG L for Powerline"(s)
34 family: "Meslo LG M DZ for Powerline"(s)
35 family: "Meslo LG M for Powerline"(s)
36 family: "Meslo LG S DZ for Powerline"(s)
37 family: "Meslo LG S for Powerline"(s)
38 family: "PowerlineSymbols"(s)
39 family: "Source Code Pro for Powerline"(s)
40 family: "Source Code Pro for Powerline"(s) "Source Code Pro Black"(s)
41 family: "Source Code Pro for Powerline"(s) "Source Code Pro ExtraLight"(s)
42 family: "Source Code Pro for Powerline"(s) "Source Code Pro Light"(s)
43 family: "Source Code Pro for Powerline"(s) "Source Code Pro Medium"(s)
44 family: "Source Code Pro for Powerline"(s) "Source Code Pro Semibold"(s)
45 family: "Terminus for Powerline"(s)
46 family: "Ubuntu Mono derivative Powerline"(s)
47 family: "xos4 Terminess Powerline"(s)
48 family: "xos4 Terminus for Powerline"(s)
49 -->
diff --git a/utils/gtk-3.0.css b/utils/gtk-3.0.css
deleted file mode 100644
index c31c8bf..0000000
--- a/utils/gtk-3.0.css
+++ /dev/null
@@ -1,132 +0,0 @@
1/* name or link this file ~/.config/gtk-3.0/gtk.css */
2
3/*
4#vim-menubar,
5#vim-menubar #menu,
6#vim-toolbar,
7#vim-gui-drawarea,
8#vim-main-window {
9 color:#6060af;
10 color: #4e4e4e;
11 font-family: "Hasklug Nerd Font Mono", "Source Code Pro for Powerline", "Source Code Pro", "Roboto";
12 font-weight:bold;
13 font-size:8pt;
14 border:0;
15 outline:0;
16}
17
18* {
19 border-width:0px;
20 outline-width:0px;
21 padding:0;
22 margin:0;
23}
24
25#vim-menubar
26{
27 padding-left:1em;
28 border-bottom:2px solid #ffffff;
29}
30
31#vim-menubar>*
32{
33 padding-right:1em;
34 padding-top:.25em;
35 padding-bottom:.25em;
36}
37
38#vim-menubar>*,
39#vim-main-window {
40 background-color:#ffffff;
41 color: #4e4e4e;
42}
43
44menu menuitem:backdrop, menu menuitem:backdrop:hover
45{
46 border:0px;
47}
48*/
49
50
51
52window#vim-main-window > box
53{
54 background: currentColor;
55 border:2px solid transparent;
56}
57
58/* within window > box ... */
59menubar#vim-menubar {
60 font-family: "monospace";
61 font-size:8pt;
62 background: transparent;
63 color:lighter(currentColor);
64 /* background: linear-gradient(180deg, white 85%, black); */
65}
66
67menubar#vim-menubar menuitem {
68 background:transparent;
69 color:mix(currentColor,#fff,0.5);
70}
71
72
73
74menubar#vim-menubar > menuitem {
75 padding:.25em;
76}
77
78menubar#vim-menubar > menuitem:disabled accelerator
79{
80 color:#f00;
81}
82
83menubar#vim-menubar menuitem box {
84 padding:.1em .25em;
85}
86
87menubar#vim-menubar menuitem window
88{
89 margin-top:1em;
90}
91
92/* opened menu (after being clicked) */
93menubar#vim-menubar menuitem window menu {
94 background:lighter(currentColor);
95 padding:0;
96 margin:0;
97 border:0;
98}
99
100menubar#vim-menubar menuitem window menu menuitem {
101 padding:0em;
102 margin:0px;
103 border:0px;
104}
105
106menubar#vim-menubar menuitem window menu menuitem box {
107 padding:.25em;
108 padding-left:.5em;
109}
110
111menubar#vim-menubar menuitem window menu separator {
112 margin:0;
113 background:currentColor;
114 border-top:1px dotted #666;
115}
116
117
118menubar#vim-menubar menuitem:hover {
119 box-shadow:none;
120 background:darker(currentColor);
121 color:#fff;
122}
123
124
125
126
127
128
129/*
130toolbar button {
131notebook tab {
132*/
diff --git a/utils/gtkrc-2.0 b/utils/gtkrc-2.0
deleted file mode 100644
index 05caadc..0000000
--- a/utils/gtkrc-2.0
+++ /dev/null
@@ -1 +0,0 @@
1gtk-icon-theme-name="gnome"
diff --git a/utils/locale.conf b/utils/locale.conf
deleted file mode 100644
index cd2bb00..0000000
--- a/utils/locale.conf
+++ /dev/null
@@ -1,14 +0,0 @@
1LANG=de_DE.utf8
2LC_CTYPE=de_DE.utf8
3LC_NUMERIC=de_DE.utf8
4LC_TIME=de_DE.utf8
5LC_COLLATE=C
6LC_MONETARY=de_DE.utf8
7LC_MESSAGES=de_DE.utf8
8LC_PAPER=de_DE.utf8
9LC_NAME=de_DE.utf8
10LC_ADDRESS=de_DE.utf8
11LC_TELEPHONE=de_DE.utf8
12LC_MEASUREMENT=de_DE.utf8
13LC_IDENTIFICATION=de_DE.utf8
14LC_ALL=de_DE.utf8
diff --git a/utils/update.sh b/utils/update.sh
deleted file mode 100644
index 875dc89..0000000
--- a/utils/update.sh
+++ /dev/null
@@ -1 +0,0 @@
1git submodule update --remote --checkout --recursive --force
diff --git a/utils/xinputrc b/utils/xinputrc
deleted file mode 100644
index ebd7310..0000000
--- a/utils/xinputrc
+++ /dev/null
@@ -1,3 +0,0 @@
1# im-config(8) generated on Tue, 28 Feb 2017 13:21:48 +0100
2run_im ibus
3# im-config signature: ec6901ebc5d2dcf71d14062c6968658e -
diff --git a/vimrc b/vimrc
index 424f5f0..3d96799 100644
--- a/vimrc
+++ b/vimrc
@@ -1,33 +1,391 @@
1exec ':source '.fnamemodify($MYVIMRC,':h').'/'.'vimrc-common' 1"=======================================================================================================================
2set packpath+=pack/submodules 2" GENERAL
3"=======================================================================================================================
4set termguicolors
3 5
4if has("nvim") 6filetype on
5 set shadafile="/tmp/shada" 7filetype plugin on
8filetype indent on
9
10syntax on | " enable syntax highlighting
11syntax sync minlines=60 | " how many preceding lines will be parsed? (high performance impact)
12
13set secure | " to ensure, that modelines do not contain executable code
14set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins)
15set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig)
16set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against
17set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis
18set ignorecase smartcase | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower)
19set hlsearch incsearch | " highlight pattern while entering it (performance wise this isn't that good)
20
21
22"=======================================================================================================================
23" BASIC CODE STYLE
24"=======================================================================================================================
25" set cindent cinoptions+=(0 | " indents at the level of parentheses -- if desired
26set expandtab | " replace tabs with spaces
27set textwidth=0 | " should be set file type specific, colorcolumns is there to assist anyways
28
29set tabstop=2 | " I am sorry, but 2 is simply better
30set shiftwidth=2 | " .
31set softtabstop=2 | " .
32
33"=======================================================================================================================
34" PATH -- where to search for includes (e.g. `gf` or `:find`)
35"=======================================================================================================================
36set path+=**4 | " allow recursive searches for files (limit depth by 4)
37if executable("uname") " does not work under Windows
38 let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include"
6endif 39endif
7 40
8if exists("g:neovide") 41if filereadable("/bin/bash")
9 " neovide specific 42 set shell=/bin/bash
10 set guifont=monospace:h11:b 43elseif filereadable("/usr/local/bin/bash")
11 " :#e-subpixelantialias:#h-full 44 set shell=/usr/local/bin/bash
12 let g:neovide_cursor_animation_length=0.03 45elseif has("win32")
13 let g:neovide_cursor_trail_size=0.8 46 set shell="cmd.exe"
14 let g:neovide_scroll_animation_length = 0.05
15 let g:neovide_transparency = 0.9
16endif 47endif
17 48
18" if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) 49" ======================================================================================================================
19" autocmd TextYankPost * call system("wl-copy", get(v:event, 'regcontents')) 50" SETTINGS:
20" nnoremap p :silent put =system('wl-paste')<CR> 51" ======================================================================================================================
21" nnoremap P :silent put! =system('wl-paste')<CR> 52set breakindent | " Every wrapped line will continue visually indented
22" endif 53set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well)
23 54set concealcursor=nc | " limits the display of concealed text to normal and command mode
24" scripts from the default vim installation, which do not get loaded by default, but are useful. 55set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX)
25" if filereadable($VIMRUNTIME.'/macros/editexisting.vim') 56set confirm | " asks 'do you want to save?'
26" packadd! editexisting 57set cpoptions+=P | " makes :w filename set the current buffer to filename
27" endif 58set hidden | " allows switching buffers even if the current buffer contains changes (displays +)
28" 59set linebreak | " wrap long lines at char 'breakat', not inside words
29" " load default plugin 'matchit' to allow % to jump between tags 60set mousemodel=popup | " only in gvim: right click opens a pop-up-menu
30" if filereadable($VIMRUNTIME.'/macros/matchit.vim') 61set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode
31" packadd! matchit 62set noautochdir | " When on, Vim will change the current working directory
32" endif 63set nostartofline | " when scrolling: do not move the cursor to column 1
33" 64set nowrap | " but do not (by default) wrap long lines around
65set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers
66
67set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for
68set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge
69set scrolloff=4 | " keeps cursor centered
70set shiftround | " indent/un-indent snaps to multiple of shiftwidths
71set writedelay=0
72
73" display and performance
74set lazyredraw | " disables redraw during macro execution (improves performance, but causes problems with solid backgrounds)
75set cmdheight=2 | " sets the command line's height
76set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators
77set nocursorcolumn | " turn visual cursor column off (improves performance)
78set updatetime=80 | " updates the screen more often
79set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry
80set notimeout | " improves performance but is known to cause problems on slow terminals
81set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms-
82set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
83set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always
84set shortmess+=I | " don't give the intro message when starting Vim |:intro|.
85set wildmenu | " use a menu in the command line
86set wildmode=longest:full | " do not preselect any entry and show all possible
87
88" code completion
89" set dictionary=/usr/share/dict/cracklib-small
90set isfname-== | " remove = as char in filenames, because most FSs do not support it
91set complete+=d | " scan current and included files for defined name or macro
92set complete+=i | " scan current and included files for completions
93set complete+=k | " make default completer <C-N> respect the dictionary
94set complete-=u | " scan current and included files
95set complete+=i | " scan current and included files
96set complete+=d | " scan current and included files for defined name or macro
97" set complete=d | " scan current and included files for defined name or macro
98set completeopt+=noinsert | " Do not insert any text for a match until the user selects one
99set completeopt+=noselect | " Do not select a completion from the menu, let the user do that
100set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore]
101set tags+=../tags
102
103" code folding...
104set nofoldenable | " disable folding, because we have zi to toggle foldenable :)
105set foldclose=all | " automatically fold, when the cursor leaves the folded area
106set foldcolumn=0 | " I think I don't need this second indicator
107" set numberwidth=5
108" set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow
109set foldnestmax=1 | " top level folding only
110set foldopen=block,hor,search | " when do we unfold?
111" set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]*/]\\+','\ ','g'),'^[[:space:]*]','','g'))
112set foldtext=repeat('\ ',indent(v:foldstart)-1).join(getline(v:foldstart,v:foldend))[:winwidth(0)]->substitute('[[:space:]]\\+','\ ','g')
113
114" works ...
115" set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1
116set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1}))
117
118" vim window behaviour
119set splitbelow | " open new windows below the current one (i find that more intuitive)
120set splitright | " this also works for me and makes better use of the scren space I think
121set winminwidth=0 | " (and all other windows, so TODO: watch out)
122set winwidth=30 | " keep NERDTreeWindow at least this size
123
124" vim session handling and restore behaviour
125set viminfo+=% | " restore buffer list
126set sessionoptions=
127set sessionoptions+=buffers
128set sessionoptions+=curdir
129set sessionoptions+=folds
130set sessionoptions+=resize
131set sessionoptions+=slash
132set sessionoptions+=tabpages
133set sessionoptions+=unix
134set sessionoptions+=winpos
135set sessionoptions+=winsize
136
137" set nocindent smartindent | " use smart indent rather then cindent
138set noautoindent
139set nosmartindent
140
141set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths
142set noequalalways | " do not evenly size windows when opening new or closing old
143set nocursorline | " turn visual cursor line off (improves performance)
144
145"=======================================================================================================================
146" SPELL_CHECKING:
147"=======================================================================================================================
148let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
149" add local user default spell file as primary source for words
150let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add"
151
152set nospell | " disable spell checker by default
153set spelllang=en,de | " languages for the spell checker
154set spellsuggest=10 | " how many words will z= suggest?
155set thesaurus+=~/.vim/thesaurus/php.txt
156
157if &diff " only for diff mode/vimdiff
158 set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync
159 set foldmethod=syntax
160endif
161
162"=======================================================================================================================
163" UNDO:
164" Persistent undo behaviour, also keeps undo history between starts
165"=======================================================================================================================
166if has('persistent_undo')
167 if isdirectory('/dev/shm')
168 set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes
169 set directory=/dev/shm/ | " swap file directory to RAM
170 set swapfile
171 elseif isdirectory('/tmp/')
172 set undodir=/tmp/
173 endif
174 set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence)
175endif
176
177
178"=======================================================================================================================
179" DISPLAY & MULTI_BYTE
180"=======================================================================================================================
181if has("multi_byte")
182 scriptencoding utf-8 | " tell vim that we are using UTF-8 here
183 set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below)
184 set termencoding=utf-8 | " we just assume that this is supported.
185
186 set fillchars= | " initialize empty fillchars
187 set listchars= | " initialize empty listchars
188
189 if &term ==# 'linux'
190 set fillchars+=vert:\│ | " cool vertical split char
191 else
192 set fillchars+=vert:\║ | " cool vertical split char
193 endif
194
195 set fillchars+=fold:\ | "
196 set fillchars+=diff:\ | " a white space gets used here
197
198 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
199 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
200
201 set listchars+=tab:▏\ | "
202 set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars)
203 " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars)
204 " set listchars+=space:⸳ | " · | " symbols used when using :set list (which displays non-printable chars)
205 set showbreak+=› | " symbol used in the beginning of a wrapped line
206
207 " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective)
208 set nolist
209
210 autocmd InsertEnter * set list
211 autocmd InsertLeave * set list&
212
213 autocmd InsertEnter * set colorcolumn=80,120
214 autocmd InsertLeave * set colorcolumn&
215 " set fillchars+=stlnc:\― | "
216end
217
218
219"=======================================================================================================================
220" AUTOCMDs and FileType specific stuff
221"=======================================================================================================================
222if has("autocmd")
223 " use the shada/viminfo file to return the cursor to where it was...
224 autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif
225
226 " Workaround: Allows Vim to yank text within wayland
227 " XDG_SESSION_TYPE is only set if a login manager was used
228 " WAYLAND_DISPLAY should always work
229 " if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) && !has('nvim')
230 " autocmd TextYankPost * call system("wl-copy", getreg('+'))
231 " endif
232
233 autocmd TextYankPost * echo '> text yanked to '.
234 \ (get(v:event,'regname') == ''
235 \ ? 'default register'
236 \ : 'register '.get(v:event,'regname'))
237
238
239 autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' })
240 autocmd InsertEnter * silent! call matchdelete(101)
241
242
243 "====================================================================================================================
244 augroup FILETYPES
245 " indent within <script> and <style> (default is a zero indent)
246 let g:html_indent_script1 = "inc"
247 let g:html_indent_style1 = "inc"
248
249 " let g:loaded_ruby_provider = 1 " disable ruby support
250 " let g:loaded_python_provider = 1 " disable python 3
251
252 let g:LatexBox_latexmk_preview_continuously = 1
253 let g:LatexBox_viewer = "evince"
254
255 autocmd FileType python setlocal keywordprg=pydoc
256 autocmd FileType vim setlocal keywordprg=:help |.
257 autocmd FileType conf setlocal isfname-==
258 autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort
259 autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O>
260
261 autocmd Filetype html,htmldjango,xml
262 \ :nnoremap
263 \ <M-Down>
264 \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>|
265 \ :nnoremap
266 \ <M-Up>
267 \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>|
268 \ :nnoremap
269 \ <leader>=
270 \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat=
271 augroup END
272endif
273
274" ======================================================================================================================
275augroup CUSTOM_COMMANDS
276 command! Qfls call setqflist([],'r',{ 'title':'listed buffers', 'items':map(getbufinfo({"buflisted":1}), '{"bufnr":get(v:val,"bufnr"),"lnum":get(v:val,"lnum"),"module":printf("%-*s",winwidth(0)-4,fnamemodify(get(v:val,"name"),":t"))}') })
277 command! Ctoggle
278 \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif
279 command! Ltoggle
280 \ if(get(getloclist(0, {'winid':1}), 'winid') == win_getid())|lclose|else|lopen|endif
281 command! BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))'))
282 command! BufToArg :argadd %:.
283 command! Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})})
284 " the following command opens a preview-window and shows the declaration of
285 " the function under the cursor. It also highlights the word to make it easier
286 " to spot within a great file
287 command! Helpme au! CursorHold * nested let @/=expand('<cword>')|exe "silent! psearch ".expand("<cword>")
288 command! FindInAllBuffers cex [] | bufdo vimgrepadd //g % | cw
289augroup END
290
291"=======================================================================================================================
292augroup KEYBOARD_MAPPING
293 " map CTRL-PageUp/Down to next/previous buffer
294 " and Shift-PageUp/Down to next/previous arglist file
295 nnoremap <C-PageUp> :bn<CR>
296 nnoremap <C-PageDown> :bp<CR>
297 nnoremap <S-PageUp> :N<CR>
298 nnoremap <S-PageDown> :n<CR>
299
300 nnoremap <F4> :wincmd c<CR>
301 nnoremap <F5> :make!<CR>
302 nnoremap <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR>
303 nnoremap <F7> :Ltoggle<CR>
304 nnoremap <F8> :Ctoggle<CR>
305 nnoremap <F9> :TagbarToggle<CR>
306 "" remap <..>
307 nnoremap <F12> :Qfls<CR>:Ctoggle<CR>
308
309 " close current buffer with <leader>q...
310 nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>.
311 nnoremap <leader>r :syntax sync fromstart
312
313 nnoremap <silent> <A-Up> :wincmd k<CR>
314 nnoremap <silent> <A-Down> :wincmd j<CR>
315 nnoremap <silent> <A-Left> :wincmd h<CR>
316 nnoremap <silent> <A-Right> :wincmd l<CR>
317
318
319 inoremap <C-S> <C-O>:w<CR>
320
321 " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s)
322 nnoremap <leader>Q !!$SHELL<CR>
323 " google the word under the cursor
324 nnoremap <leader>g :execute ":!xdg-open https://google.de/search?q=".expand("<cword>")<CR>
325 nnoremap <leader>u :execute ":!xdg-open ".expand("<cWORD>")<CR>
326 " display highlight group under the cursor
327 nnoremap <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR>
328
329
330 " ======================================================================================================================
331 " SHORTCUTS: custom shortcuts
332 " inoremap <C-Space> <C-x><C-o>
333 " inoremap <C-@> <C-Space>
334
335 " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim)
336 inoremap <C-Backspace> <C-W>
337
338 " INDENTATION: allows un-indenting a selected block and keeps selection
339 vnoremap < <gv
340 vnoremap > >gv
341
342 " make shift-home select to the beginning of the line
343 nnoremap <s-home> v^
344 nnoremap <s-end> v$
345
346 nnoremap <s-down> vj
347 vnoremap <s-down> j
348 nnoremap <s-up> vk
349 vnoremap <s-up> k
350
351 " if the wildmenu is configured to to display suggestions vertically, then
352 " reconfigure the cursor keys to work in that direction
353 if &wildoptions =~# 'pum'
354 cnoremap <expr> <up> pumvisible() ? "<C-p>" : "\<up>"
355 cnoremap <expr> <down> pumvisible() ? "<C-n>" : "\<down>"
356 endif
357
358
359 " INSERT_MODE_MAPPINGS:
360 " default copy&paste insert key binding (just in insert mode, so it doesn't conflict
361 " with visual block mode)- would have been nice, but collides with c-w for digraphs
362 " inoremap <C-V> <C-R>+
363
364 " NEOVIM_SPECIFIC:
365 if has('nvim') " only neovim...
366 " shortcut \t opens a terminal in a horizontal split
367 nnoremap <leader>t :new +terminal<CR>
368 endif
369augroup END
370
371augroup NETRW
372 " Deprecated with this configuration, but still useful when deactivating some Plugins
373 " NETRW: obsolete with NERDTree
374 let g:netrw_alto = 0 | " open files on the right
375 let g:netrw_altv = 1 | " open files on the right
376 let g:netrw_banner = 0 | " display help messages?
377 let g:netrw_browse_split = 4 | " 4=open in previous window
378 let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors)
379 let g:netrw_hide = 1 | " show not-hidden files only
380 let g:netrw_keepdir = 1 | " because that works better, when gf finds a path name
381 let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot
382 let g:netrw_liststyle = 3 | " 3=tree
383 let g:netrw_preview = 0 | "
384 let g:netrw_winsize = 20 | " window size in percent
385 " let s:treedepthstring = "│ " | " this is not going to work, but left here for documentation
386augroup END
387
388
389"=======================================================================================================================
390" v modeline, do not chnage v
391" vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:\<,\>,\-,\& number
diff --git a/vimrc-common b/vimrc-common
deleted file mode 100644
index dc48045..0000000
--- a/vimrc-common
+++ /dev/null
@@ -1,379 +0,0 @@
1"=======================================================================================================================
2" GENERAL
3"=======================================================================================================================
4
5filetype on
6filetype plugin on
7filetype indent on
8
9syntax on | " enable syntax highlighting
10syntax sync minlines=60 | " how many preceding lines will be parsed? (high performance impact)
11
12set secure | " to ensure, that modelines do not contain executable code
13set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins)
14set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig)
15set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against
16set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis
17set ignorecase smartcase | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower)
18set hlsearch incsearch | " highlight pattern while entering it (performance wise this isn't that good)
19
20
21"=======================================================================================================================
22" BASIC CODE STYLE
23"=======================================================================================================================
24" set cindent cinoptions+=(0 | " indents at the level of parentheses -- if desired
25set expandtab | " replace tabs with spaces
26set textwidth=0 | " should be set file type specific, colorcolumns is there to assist anyways
27set tabstop=4
28set shiftwidth=4
29set softtabstop=4
30
31
32" ======================================================================================================================
33" SETTINGS:
34" ======================================================================================================================
35set breakindent | " Every wrapped line will continue visually indented
36set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well)
37set concealcursor=nc | " limits the display of concealed text to normal and command mode
38set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX)
39set confirm | " asks 'do you want to save?'
40set cpoptions+=P | " makes :w filename set the current buffer to filename
41set hidden | " allows switching buffers even if the current buffer contains changes (displays +)
42set linebreak | " wrap long lines at char 'breakat', not inside words
43set mousemodel=popup | " only in gvim: right click opens a pop-up-menu
44set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode
45set noautochdir | " When on, Vim will change the current working directory
46set nostartofline | " when scrolling: do not move the cursor to column 1
47set nowrap | " but do not (by default) wrap long lines around
48set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers
49
50if has('nvim') " Neovim?
51 set inccommand=nosplit | " preview substitute and such things in real time
52endif
53
54if exists("g:neovide")
55 set guifont=monospace:h11:b
56 let g:neovide_cursor_animation_length=0
57 let g:neovide_scroll_animation_length = 0.5
58 let g:neovide_cursor_trail_size=0.8
59 let g:neovide_cursor_vfx_mode = ""
60 let g:neovide_transparency = 0.9
61 let g:neovide_floating_blur_amount_x = 4.0
62 let g:neovide_floating_blur_amount_y = 4.0
63 let g:neovide_background_color = '#383a62'
64 let g:neovide_scale_factor = 1.0
65endif
66
67set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for
68set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge
69set scrolloff=4 | " keeps cursor centered
70set shiftround | " indent/un-indent snaps to multiple of shiftwidths
71set writedelay=0
72
73" display and performance
74set lazyredraw | " disables redraw during macro execution (improves performance, but causes problems with solid backgrounds)
75set cmdheight=2 | " sets the command line's height
76set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators
77set nocursorcolumn | " turn visual cursor column off (improves performance)
78set updatetime=80 | " updates the screen more often
79set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry
80set notimeout | " improves performance but is known to cause problems on slow terminals
81set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms-
82set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering)
83set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always
84set shortmess+=I | " don't give the intro message when starting Vim |:intro|.
85set wildmenu | " use a menu in the command line
86set wildmode=longest:full | " do not preselect any entry and show all possible
87
88" code completion
89" set dictionary=/usr/share/dict/cracklib-small
90set isfname-== | " remove = as char in filenames, because most FSs do not support it
91set complete+=d | " scan current and included files for defined name or macro
92set complete+=i | " scan current and included files for completions
93set complete+=k | " make default completer <C-N> respect the dictionary
94set complete-=u | " scan current and included files
95set complete+=i | " scan current and included files
96set complete+=d | " scan current and included files for defined name or macro
97" set complete=d | " scan current and included files for defined name or macro
98set completeopt+=noinsert | " Do not insert any text for a match until the user selects one
99set completeopt+=noselect | " Do not select a completion from the menu, let the user do that
100set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore]
101set tags+=../tags
102
103" code folding...
104set nofoldenable | " disable folding, because we have zi to toggle foldenable :)
105set foldclose=all | " automatically fold, when the cursor leaves the folded area
106set foldcolumn=0 | " I think I don't need this second indicator
107" set numberwidth=5
108" set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow
109set foldnestmax=1 | " top level folding only
110set foldopen=block,hor,search | " when do we unfold?
111" set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]*/]\\+','\ ','g'),'^[[:space:]*]','','g'))
112set foldtext=repeat('\ ',indent(v:foldstart)-1).join(getline(v:foldstart,v:foldend))[:winwidth(0)]->substitute('[[:space:]]\\+','\ ','g')
113
114" works ...
115" set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1
116set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1}))
117
118" vim window behaviour
119set splitbelow | " open new windows below the current one (i find that more intuitive)
120set splitright | " this also works for me and makes better use of the scren space I think
121set winminwidth=0 | " (and all other windows, so TODO: watch out)
122set winwidth=30 | " keep NERDTreeWindow at least this size
123
124" vim session handling and restore behaviour
125set viminfo+=% | " restore buffer list
126set sessionoptions=
127set sessionoptions+=buffers
128set sessionoptions+=curdir
129set sessionoptions+=folds
130set sessionoptions+=resize
131set sessionoptions+=slash
132set sessionoptions+=tabpages
133set sessionoptions+=unix
134set sessionoptions+=winpos
135set sessionoptions+=winsize
136
137" set nocindent smartindent | " use smart indent rather then cindent
138set noautoindent
139set nosmartindent
140
141set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths
142set noequalalways | " do not evenly size windows when opening new or closing old
143set nocursorline | " turn visual cursor line off (improves performance)
144
145
146"=======================================================================================================================
147" PATH -- where to search for includes (e.g. `gf` or `:find`)
148"=======================================================================================================================
149set path+=**4 | " allow recursive searches for files (limit depth by 4)
150if executable("uname") " does not work under Windows
151 let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include"
152endif
153
154
155"=======================================================================================================================
156" SPELL_CHECKING:
157"=======================================================================================================================
158let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
159" add local user default spell file as primary source for words
160let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add"
161
162set nospell | " disable spell checker by default
163set spelllang=en,de | " languages for the spell checker
164set spellsuggest=10 | " how many words will z= suggest?
165set thesaurus+=~/.vim/thesaurus/php.txt
166
167
168"=======================================================================================================================
169" UNDO:
170" Persistent undo behaviour, also keeps undo history between starts
171"=======================================================================================================================
172if has('persistent_undo')
173 if isdirectory('/dev/shm')
174 set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes
175 set directory=/dev/shm/ | " swap file directory to RAM
176 set swapfile
177 elseif isdirectory('/tmp/')
178 set undodir=/tmp/
179 endif
180 set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence)
181endif
182
183
184"=======================================================================================================================
185" DISPLAY & MULTI_BYTE
186"=======================================================================================================================
187if has("multi_byte")
188 scriptencoding utf-8 | " tell vim that we are using UTF-8 here
189 set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below)
190 set termencoding=utf-8 | " we just assume that this is supported.
191
192 set fillchars= | " initialize empty fillchars
193 set listchars= | " initialize empty listchars
194
195 if &term ==# 'linux'
196 set fillchars+=vert:\│ | " cool vertical split char
197 else
198 set fillchars+=vert:\║ | " cool vertical split char
199 endif
200
201 set fillchars+=fold:\ | "
202 set fillchars+=diff:\ | " a white space gets used here
203
204 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
205 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
206
207 set listchars+=tab:▏\ | "
208 set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars)
209 " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars)
210 " set listchars+=space:⸳ | " · | " symbols used when using :set list (which displays non-printable chars)
211 set showbreak+=› | " symbol used in the beginning of a wrapped line
212
213 " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective)
214 set nolist
215
216 autocmd InsertEnter * set list
217 autocmd InsertLeave * set list&
218
219 autocmd InsertEnter * set colorcolumn=80,120
220 autocmd InsertLeave * set colorcolumn&
221 " set fillchars+=stlnc:\― | "
222end
223
224
225"=======================================================================================================================
226" AUTOCMDs and FileType specific stuff
227"=======================================================================================================================
228if has("autocmd")
229 " use the shada/viminfo file to return the cursor to where it was...
230 autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif
231
232 " Workaround: Allows Vim to yank text within wayland
233 " XDG_SESSION_TYPE is only set if a login manager was used
234 " WAYLAND_DISPLAY should always work
235 " if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) && !has('nvim')
236 " autocmd TextYankPost * call system("wl-copy", getreg('+'))
237 " endif
238
239 autocmd TextYankPost * echo '> text yanked to '.
240 \ (get(v:event,'regname') == ''
241 \ ? 'default register'
242 \ : 'register '.get(v:event,'regname'))
243
244
245 autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' })
246 autocmd InsertEnter * silent! call matchdelete(101)
247
248
249 "====================================================================================================================
250 augroup FILETYPES
251 " indent within <script> and <style> (default is a zero indent)
252 let g:html_indent_script1 = "inc"
253 let g:html_indent_style1 = "inc"
254
255 " let g:loaded_ruby_provider = 1 " disable ruby support
256 " let g:loaded_python_provider = 1 " disable python 3
257
258 let g:LatexBox_latexmk_preview_continuously = 1
259 let g:LatexBox_viewer = "evince"
260
261 autocmd FileType python setlocal keywordprg=pydoc
262 autocmd FileType vim setlocal keywordprg=:help |.
263 autocmd FileType conf setlocal isfname-==
264 autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort
265 autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O>
266
267 autocmd Filetype html,htmldjango,xml
268 \ :nnoremap
269 \ <M-Down>
270 \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>|
271 \ :nnoremap
272 \ <M-Up>
273 \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>|
274 \ :nnoremap
275 \ <leader>=
276 \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat=
277 augroup END
278endif
279
280" ======================================================================================================================
281augroup CUSTOM_COMMANDS
282 command! Qfls call setqflist([],'r',{ 'title':'listed buffers', 'items':map(getbufinfo({"buflisted":1}), '{"bufnr":get(v:val,"bufnr"),"lnum":get(v:val,"lnum"),"module":printf("%-*s",winwidth(0)-4,fnamemodify(get(v:val,"name"),":t"))}') })
283 command! Ctoggle
284 \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif
285 command! Ltoggle
286 \ if(get(getloclist(0, {'winid':1}), 'winid') == win_getid())|lclose|else|lopen|endif
287 command! BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))'))
288 command! BufToArg :argadd %:.
289 command! Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})})
290 " the following command opens a preview-window and shows the declaration of
291 " the function under the cursor. It also highlights the word to make it easier
292 " to spot within a great file
293 command! Helpme au! CursorHold * nested let @/=expand('<cword>')|exe "silent! psearch ".expand("<cword>")
294 command! FindInAllBuffers cex [] | bufdo vimgrepadd //g % | cw
295augroup END
296
297"=======================================================================================================================
298augroup KEYBOARD_MAPPING
299 " map CTRL-PageUp/Down to next/previous buffer
300 " and Shift-PageUp/Down to next/previous arglist file
301 nnoremap <C-PageUp> :bn<CR>
302 nnoremap <C-PageDown> :bp<CR>
303 nnoremap <S-PageUp> :N<CR>
304 nnoremap <S-PageDown> :n<CR>
305
306 nnoremap <F4> :wincmd c<CR>
307 nnoremap <F5> :make!<CR>
308 nnoremap <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR>
309 nnoremap <F7> :Ltoggle<CR>
310 nnoremap <F8> :Ctoggle<CR>
311 nnoremap <F9> :TagbarToggle<CR>
312 "" remap <..>
313 nnoremap <F12> :Qfls<CR>:Ctoggle<CR>
314
315 " close current buffer with <leader>q...
316 nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>.
317 nnoremap <leader>r :syntax sync fromstart
318
319 nnoremap <silent> <A-Up> :wincmd k<CR>
320 nnoremap <silent> <A-Down> :wincmd j<CR>
321 nnoremap <silent> <A-Left> :wincmd h<CR>
322 nnoremap <silent> <A-Right> :wincmd l<CR>
323
324
325 inoremap <C-S> <C-O>:w<CR>
326
327 " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s)
328 nnoremap <leader>Q !!$SHELL<CR>
329 " google the word under the cursor
330 nnoremap <leader>g :execute ":!xdg-open https://google.de/search?q=".expand("<cword>")<CR>
331 nnoremap <leader>u :execute ":!xdg-open ".expand("<cWORD>")<CR>
332 " display highlight group under the cursor
333 nnoremap <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR>
334
335
336 " ======================================================================================================================
337 " SHORTCUTS: custom shortcuts
338 " inoremap <C-Space> <C-x><C-o>
339 " inoremap <C-@> <C-Space>
340
341 " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim)
342 inoremap <C-Backspace> <C-W>
343
344 " INDENTATION: allows un-indenting a selected block and keeps selection
345 vnoremap < <gv
346 vnoremap > >gv
347
348 " make shift-home select to the beginning of the line
349 nnoremap <s-home> v^
350 nnoremap <s-end> v$
351
352 nnoremap <s-down> vj
353 vnoremap <s-down> j
354 nnoremap <s-up> vk
355 vnoremap <s-up> k
356
357 " if the wildmenu is configured to to display suggestions vertically, then
358 " reconfigure the cursor keys to work in that direction
359 if &wildoptions =~# 'pum'
360 cnoremap <expr> <up> pumvisible() ? "<C-p>" : "\<up>"
361 cnoremap <expr> <down> pumvisible() ? "<C-n>" : "\<down>"
362 endif
363
364
365 " INSERT_MODE_MAPPINGS:
366 " default copy&paste insert key binding (just in insert mode, so it doesn't conflict
367 " with visual block mode)- would have been nice, but collides with c-w for digraphs
368 " inoremap <C-V> <C-R>+
369
370 " NEOVIM_SPECIFIC:
371 if has('nvim') " only neovim...
372 " shortcut \t opens a terminal in a horizontal split
373 nnoremap <leader>t :new +terminal<CR>
374 endif
375augroup END
376
377"=======================================================================================================================
378" v modeline, do not chnage v
379" vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\<,\>,\-,\& number
..