diff options
64 files changed, 757 insertions, 1442 deletions
diff --git a/doc/shortcuts.txt b/README.md index 5e911ea..2d5747f 100644..100755 --- a/doc/shortcuts.txt +++ b/README.md | |||
@@ -1,3 +1,53 @@ | |||
1 | # Installation | ||
2 | ``` | ||
3 | git clone http://git.entwicklerseite.de/vim ~/.config/nvim/ | ||
4 | ``` | ||
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 | |||
16 | ``` | ||
17 | . | ||
18 | ├── after | ||
19 | │ ├── ftdetect | ||
20 | │ │ └── log.vim | ||
21 | │ ├── ftplugin | ||
22 | │ │ └── python.vim | ||
23 | │ ├── indent | ||
24 | │ │ ├── html5.vim | ||
25 | │ │ ├── php.vim | ||
26 | │ │ └── yaml.vim | ||
27 | │ └── syntax | ||
28 | │ ├── c.vim | ||
29 | │ ├── log.vim | ||
30 | │ └── markdown.vim | ||
31 | ├── gvimrc | ||
32 | ├── init-mini.lua | ||
33 | ├── init.lua | ||
34 | ├── README.md | ||
35 | └── vimrc | ||
36 | ``` | ||
37 | |||
38 | |||
39 | # Cheat sheet | ||
40 | For different working scenarios. | ||
41 | |||
42 | ## vim | ||
43 | |||
44 | - use `<C-d>` to expand autocompletion on the `:` command line. That works for | ||
45 | example for `:setfiletype <C-d>` to show all available filetypes. | ||
46 | |||
47 | - use `gw` or `gq` in visual mode to break selected text at the current | ||
48 | textwidth (configured with `set textwidth=80` for example) | ||
49 | |||
50 | ``` | ||
1 | :viusage = summary of all keyboard shortcuts | 51 | :viusage = summary of all keyboard shortcuts |
2 | :options = shows currently :set options (with descriptions) | 52 | :options = shows currently :set options (with descriptions) |
3 | leader key = usually set to backslash expects a quick command | 53 | leader key = usually set to backslash expects a quick command |
@@ -202,5 +252,47 @@ gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 t | |||
202 | [vim modeline] | 252 | [vim modeline] |
203 | filetype can have multiple values, like python.django | 253 | filetype can have multiple values, like python.django |
204 | The last line can be a mode line, which holds settings like tab width: | 254 | The last line can be a mode line, which holds settings like tab width: |
255 | ``` | ||
256 | |||
257 | |||
258 | ## git | ||
259 | |||
260 | undo last commit: git reset HEAD~ | ||
261 | diff two branches: git diff branch1 branch2 path/to/file | ||
262 | |||
263 | |||
264 | |||
265 | To `~/.gitconfig` add: | ||
266 | [alias] | ||
267 | 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 | ||
268 | |||
269 | Provides you with `git branchvv`, a command that works similar to `git branch`, | ||
270 | but sorts the branches by modification date and displays them. | ||
271 | |||
272 | |||
273 | # gnu screen | ||
274 | |||
275 | To run Vim in a gnu screen session: | ||
276 | |||
277 | TERM=vte-256color screen vim | ||
278 | |||
279 | But if you are using another terminal there may be further options with even | ||
280 | more capabilities. Starting point for you search could be something like: | ||
281 | |||
282 | find /usr/share/terminfo/ | grep screen | grep 256 | ||
283 | |||
284 | # gvim | ||
285 | |||
286 | Change the default brackground of applications if you see an ugly grey border | ||
287 | around your beatiful theme: | ||
288 | |||
289 | ``` | ||
290 | /* to be saved as ~/.config/gtk-3.0/gtk.css | ||
291 | * thanks to http://stackoverflow.com/users/6899000/proprefenetre */ | ||
292 | @define-color YOUR_BACKGROUND_COLOR #rrggbb; | ||
293 | |||
294 | window#vim-main-window { | ||
295 | background-color: @YOUR_BACKGROUND_COLOR; | ||
296 | } | ||
297 | ``` | ||
205 | 298 | ||
206 | # vim: noai:ts=2:sw=2 filetype=dosini.text | ||
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..44223e6 100644..100755 --- a/after/syntax/log.vim +++ b/after/syntax/log.vim | |||
diff --git a/after/syntax/markdown.vim b/after/syntax/markdown.vim index 7bdbf46..7bdbf46 100644..100755 --- a/after/syntax/markdown.vim +++ b/after/syntax/markdown.vim | |||
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 @@ | |||
1 | undo last commit: git reset HEAD~ | ||
2 | diff 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 @@ | |||
1 | GIT_PAGER=less git config --list | awk 'match($0, "submodule.(.*).url=(.*)",q){ system("echo git submodule add " q[2] " " q[1]) }' | ||
2 | |||
3 | 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 | ||
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 | |||
5 | window#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 | |||
4 | 2html erlang master sinda | ||
5 | HGAnnotate eruby matlab sindacmp | ||
6 | PKGBUILD esmtprc maxima sindaout | ||
7 | a2ps esqlc mel sisu | ||
8 | a65 esterel messages skill | ||
9 | aap eterm mf sl | ||
10 | abap euphoria3 mgl slang | ||
11 | abaqus euphoria4 mgp slice | ||
12 | abc eviews mib slim | ||
13 | abel exim mix slpconf | ||
14 | acedb expect mma slpreg | ||
15 | ada exports mmix slpspi | ||
16 | aflex falcon mmp slrnrc | ||
17 | ahdl fan modconf slrnsc | ||
18 | alsaconf fasm model sm | ||
19 | amiga fdcc modsim3 smarty | ||
20 | aml fetchmail modula2 smcl | ||
21 | ampl fgl modula3 smil | ||
22 | ansible fish monk smith | ||
23 | ansible_hosts flexwiki moo sml | ||
24 | ansible_template focexec mp snnsnet | ||
25 | ant form mplayerconf snnspat | ||
26 | antlr forth mrxvtrc snnsres | ||
27 | apache fortran msidl snobol4 | ||
28 | apachestyle foxpro msmessages solidity | ||
29 | aptconf framescript msql spec | ||
30 | arch freebasic mupad specman | ||
31 | arduino fstab mush spice | ||
32 | art fvwm mustache splint | ||
33 | asciidoc fvwm2m4 muttrc spup | ||
34 | asm gdb mysql spyce | ||
35 | asm68k gdmo named sql | ||
36 | asmh8300 gedcom nanorc sqlanywhere | ||
37 | asn git nasm sqlforms | ||
38 | aspperl gitcommit nastran sqlhana | ||
39 | aspvbs gitconfig natural sqlinformix | ||
40 | asterisk gitolite ncf sqlj | ||
41 | asteriskvm gitrebase netrc sqloracle | ||
42 | atlas gitsendemail netrw sqr | ||
43 | augeas gkrellmrc nginx squid | ||
44 | autohotkey glsl nim srec | ||
45 | autoit gnash ninja sshconfig | ||
46 | automake gnomecat nix sshdconfig | ||
47 | ave gnuplot nosyntax st | ||
48 | avra go nqc stata | ||
49 | awk godefstack nroff stp | ||
50 | ayacc godoc nsis strace | ||
51 | b gohtmltmpl obj stylus | ||
52 | baan gotexttmpl objc sudoers | ||
53 | basic gp objcpp svg | ||
54 | bc gpg ocaml svn | ||
55 | bdf gprof occam swift | ||
56 | bib grads octave syncolor | ||
57 | bib_latexSuite gretl omnimark synload | ||
58 | bindzone groff opencl syntax | ||
59 | blade groovy openroad sysctl | ||
60 | blank group opl systemd | ||
61 | bst grub ora systemverilog | ||
62 | btm gsp pamconf tads | ||
63 | bzl gtkrc papp tags | ||
64 | bzr haml pascal tak | ||
65 | c hamster passwd takcmp | ||
66 | cabal handlebars pcap takout | ||
67 | calendar haskell pccts tap | ||
68 | catalog haste pdf tar | ||
69 | cdl hastepreproc perl taskdata | ||
70 | cdrdaoconf haxe perl6 taskedit | ||
71 | cdrtoc haxe_extended pf tasm | ||
72 | cf hb pfmain tcl | ||
73 | cfg help pgsql tcsh | ||
74 | ch hercules php teraterm | ||
75 | chaiscript hex phtml terminfo | ||
76 | change hgcommit pic tex | ||
77 | changelog hitest pike tex_LatexBox | ||
78 | chaskell hog pilrc tex_latexSuite | ||
79 | cheetah hostconf pine texinfo | ||
80 | chill hostsaccess pinfo texmf | ||
81 | chordpro hss plaintex text | ||
82 | cl html plantuml textile | ||
83 | clean html5 pli tf | ||
84 | clipper htmlcheetah plm thrift | ||
85 | clojure htmldjango plp tidy | ||
86 | cmake htmlm4 plsql tilde | ||
87 | cmake-indent htmlos po tli | ||
88 | cmake-syntax hxml pod tmux | ||
89 | cmusrc ia64 postscr tomdoc | ||
90 | cobol ibasic pov toml | ||
91 | coco icemenu povini tpp | ||
92 | coffee icon ppd trasys | ||
93 | color_coded idl ppwiz treetop | ||
94 | colortest idlang prescribe trustees | ||
95 | conaryrecipe indent privoxy tsalt | ||
96 | conf inform procmail tsscl | ||
97 | config initex progress tssgm | ||
98 | context initng prolog tssop | ||
99 | cpp inittab promela tt2 | ||
100 | cql ipfilter proto tt2html | ||
101 | crm ishd protocols tt2js | ||
102 | crontab iss ps1 twig | ||
103 | cryptol ist ps1xml typescript | ||
104 | crystal j psf uc | ||
105 | cs jal ptcap udevconf | ||
106 | csc jam pug udevperm | ||
107 | cscope_plus jargon puppet udevrules | ||
108 | csdl jasmine purescript uil | ||
109 | csh java purifylog updatedb | ||
110 | csp javacc pyrex upstart | ||
111 | css javascript python upstreamdat | ||
112 | cterm jess qf upstreaminstalllog | ||
113 | ctrlh jgraph qml upstreamlog | ||
114 | cucumber jinja2 quake upstreamrpt | ||
115 | cuda jovial r usserverlog | ||
116 | cupl jproperties racc usw2kagtlog | ||
117 | cuplsim json radiance vala | ||
118 | cuda jovial r usserverlog | ||
119 | cupl jproperties racc usw2kagtlog | ||
120 | cuplsim json radiance vala | ||
121 | cvs jsp ragel valgrind | ||
122 | cvsrc jst ratpoison vb | ||
123 | cweb jsx rc vbnet | ||
124 | cynlib julia rcs vcl | ||
125 | cynpp kconfig rcslog velocity | ||
126 | d kivy readline vera | ||
127 | dart kix rebol verilog | ||
128 | datascript kotlin redif verilogams | ||
129 | dcd kscript registry vgrindefs | ||
130 | dcl kwt remind vhdl | ||
131 | debchangelog lace resolv vim | ||
132 | debcontrol latextoc reva vimgo | ||
133 | debsources latte rexx viminfo | ||
134 | def ld rhelp virata | ||
135 | denyhosts ldapconf rib vmasm | ||
136 | desc ldif rmd voscm | ||
137 | desktop less rnc vrml | ||
138 | dictconf lex rng vroom | ||
139 | dictdconf lftp rnoweb vsejcl | ||
140 | diff lhaskell robots vundlelog | ||
141 | dircolors libao rpcgen wdiff | ||
142 | dirpager lifelines rpl web | ||
143 | diva lilo rrst webmacro | ||
144 | django limits rspec wget | ||
145 | dns liquid rst whitespace | ||
146 | dnsmasq lisp rtf winbatch | ||
147 | docbk lite ruby wml | ||
148 | docbksgml litestep rust wsh | ||
149 | docbkxml logcheck samba wsml | ||
150 | dockerfile loginaccess sas wvdial | ||
151 | dosbatch logindefs sass xbl | ||
152 | dosini logtalk sather xdefaults | ||
153 | dot lotos sbt xf86conf | ||
154 | doxygen lout scala xhtml | ||
155 | dracula lpc scala.xpt xinetd | ||
156 | dsl lprolog scheme xkb | ||
157 | dtd lscript scilab xmath | ||
158 | dtml lsl screen xml | ||
159 | dtrace lss scss xmodmap | ||
160 | dts lua sd xpm | ||
161 | dylan lynx sdc xpm2 | ||
162 | dylanintr m4 sdl xquery | ||
163 | dylanlid mail sed xs | ||
164 | ecd mailaliases sendpr xsd | ||
165 | edif mailcap sensors xsl | ||
166 | eelixir make services xslt | ||
167 | eiffel mallard setserial xxd | ||
168 | elf man sgml yacc | ||
169 | elinks manconf sgmldecl yaml | ||
170 | elixir manual sgmllnx z8a | ||
171 | elm maple sh zimbu | ||
172 | elmfilt markdown sicad zsh | ||
173 | ember-script masm sieve | ||
174 | emblem 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 @@ | |||
1 | vim configuration | ||
2 | ================= | ||
3 | |||
4 | This is the configuration I am using. | ||
5 | |||
6 | |||
7 | Screenshot | ||
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 @@ | |||
1 | To run vim inside a screen session: | ||
2 | |||
3 | TERM=vte-256color screen vim | ||
4 | |||
5 | works very well. But if you are using another terminal you may be interested in | ||
6 | other possibilities, like this: | ||
7 | |||
8 | find /usr/share/terminfo/ | grep screen | grep 256 | ||
9 | |||
@@ -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>* |
30 | endif | 30 | endif |
31 | |||
32 | 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 @@ | |||
1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
2 | if 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 | }) | ||
11 | end | ||
12 | vim.opt.rtp:prepend(lazypath) | ||
13 | require("lazy").setup(plugins, opts) | ||
14 | |||
15 | |||
16 | vim.opt.number = true | ||
17 | |||
18 | vim.opt.shiftwidth = 2 | ||
19 | vim.opt.tabstop = 2 | ||
20 | vim.opt.softtabstop = 2 | ||
21 | |||
22 | |||
23 | require('gitsigns').setup() | ||
24 | |||
25 | local cmp = require'cmp' | ||
26 | cmp.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). | ||
50 | cmp.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). | ||
58 | cmp.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 | |||
69 | require'cmp'.setup { | ||
70 | sources = { | ||
71 | { name = 'nvim_lua' } | ||
72 | } | ||
73 | } | ||
74 | |||
75 | -- Set up lspconfig. | ||
76 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | ||
77 | require("neodev").setup({ | ||
78 | capabilities = capabilities, | ||
79 | }) | ||
80 | -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled. | ||
81 | require('lspconfig').lua_ls.setup({ | ||
82 | capabilities = capabilities, | ||
83 | settings = { | ||
84 | Lua = { | ||
85 | diagnostics = { | ||
86 | globals = {'vim'} | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | }) | ||
@@ -1,43 +1,165 @@ | |||
1 | vim.cmd('source ~/.vim/vimrc') | 1 | -------------------------------------------------------------------------------- |
2 | -- lazy plugin manager | ||
3 | -------------------------------------------------------------------------------- | ||
4 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
5 | if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
6 | vim.fn.system({ | ||
7 | "git", | ||
8 | "clone", | ||
9 | "--filter = blob:none", | ||
10 | "https://github.com/folke/lazy.nvim.git", | ||
11 | "--branch = stable", -- latest stable release | ||
12 | lazypath, | ||
13 | }) | ||
14 | end | ||
15 | vim.opt.rtp:prepend(lazypath) | ||
16 | require("lazy").setup({ | ||
17 | 'nvim-tree/nvim-web-devicons', | ||
18 | 'lewis6991/gitsigns.nvim', | ||
19 | 'folke/neodev.nvim', | ||
20 | 'neovim/nvim-lspconfig', | ||
21 | 'hrsh7th/cmp-nvim-lsp', | ||
22 | 'hrsh7th/cmp-buffer', | ||
23 | 'hrsh7th/cmp-path', | ||
24 | 'hrsh7th/cmp-cmdline', | ||
25 | 'hrsh7th/nvim-cmp', | ||
26 | 'hrsh7th/vim-vsnip', | ||
27 | 'octaltree/cmp-look', | ||
28 | 'L3MON4D3/LuaSnip', | ||
29 | 'saadparwaiz1/cmp_luasnip', | ||
30 | 'RRethy/base16-nvim', | ||
31 | 'nvim-treesitter/nvim-treesitter', | ||
32 | 'nvim-lua/popup.nvim', | ||
33 | 'nvim-lua/plenary.nvim', | ||
34 | 'nvim-telescope/telescope.nvim', | ||
35 | 'nvim-telescope/telescope-media-files.nvim', | ||
36 | 'coderonline/vim-fancy-line', | ||
37 | 'coderonline/vim-recently-used', | ||
38 | 'norcalli/nvim-colorizer.lua', | ||
39 | 'folke/trouble.nvim', | ||
40 | }) | ||
2 | 41 | ||
42 | -------------------------------------------------------------------------------- | ||
43 | -- vim options, first sourced from vimrc, then appended by Neovim specific stuff | ||
44 | -------------------------------------------------------------------------------- | ||
45 | local configdir = vim.fn.fnamemodify(vim.fn.expand("$MYVIMRC"), ":p:h") | ||
46 | vim.cmd('source ' .. configdir .. '/vimrc') | ||
47 | vim.cmd.colorscheme "base16-rebecca" | ||
48 | -- vim.cmd.colorscheme "base16-katy" | ||
49 | |||
50 | vim.opt.encoding = 'utf-8' | ||
51 | vim.opt.number = true | ||
52 | vim.opt.number = true | ||
53 | vim.opt.shiftwidth = 2 | ||
54 | vim.opt.tabstop = 2 | ||
55 | vim.opt.softtabstop = 2 | ||
56 | vim.opt.inccommand = "nosplit" -- Neovim only: preview substitute and such things in real time | ||
3 | vim.opt.termguicolors = true | 57 | vim.opt.termguicolors = true |
4 | vim.opt.exrc = true | 58 | vim.opt.shadafile = configdir .. "/shada.file" |
5 | vim.opt.foldmethod = 'syntax' | 59 | |
60 | -- Restore cursor position | ||
61 | vim.api.nvim_create_autocmd({ "BufReadPost" }, { | ||
62 | callback = function() vim.cmd('silent! normal! g`"zv') end | ||
63 | }) | ||
64 | |||
65 | vim.api.nvim_create_user_command( | ||
66 | 'LspFix', | ||
67 | function() | ||
68 | vim.lsp.buf.code_action() | ||
69 | end, {} | ||
70 | ) | ||
6 | 71 | ||
7 | if vim.fn.has("win32") then | 72 | if vim.fn.has("win32") then |
8 | vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims")) | 73 | vim.opt.rtp:append(vim.fn.expand("$HOME\\scoop\\shims")) |
9 | end | 74 | end |
10 | 75 | ||
11 | vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") | 76 | vim.g.lsp_log_verbose = 1 |
12 | vim.keymap.set('n', '<F12>', ':Buffers<CR>') | 77 | vim.g.lsp_log_file = configdir .. ('/vim-lsp.log') |
13 | 78 | ||
79 | if vim.g.neovide then | ||
80 | vim.guifont = "monospace:h11:b" | ||
81 | vim.g.neovide_cursor_animation_length = 0.03 | ||
82 | vim.g.neovide_cursor_trail_size = 0.8 | ||
83 | vim.g.neovide_scroll_animation_length = 0.05 | ||
84 | vim.g.neovide_transparency = 0.9 | ||
85 | vim.g.neovide_cursor_animation_length=0 | ||
86 | vim.g.neovide_cursor_vfx_mode = "" | ||
87 | vim.g.neovide_floating_blur_amount_x = 4.0 | ||
88 | vim.g.neovide_floating_blur_amount_y = 4.0 | ||
89 | vim.g.neovide_background_color = '#383a62' | ||
90 | vim.g.neovide_scale_factor = 1.0 | ||
91 | end | ||
14 | 92 | ||
93 | -------------------------------------------------------------------------------- | ||
94 | -- plugin setup and options | ||
95 | -------------------------------------------------------------------------------- | ||
96 | require'nvim-treesitter.configs'.setup { | ||
97 | -- A list of parser names, or "all" (the five listed parsers should always be installed) | ||
98 | ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, | ||
99 | modules = {}, | ||
100 | -- Install parsers synchronously (only applied to `ensure_installed`) | ||
101 | sync_install = false, | ||
102 | -- Automatically install missing parsers when entering buffer | ||
103 | -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally | ||
104 | auto_install = true, | ||
105 | ignore_install = { "javascript" }, | ||
106 | highlight = { | ||
107 | enable = true, | ||
108 | -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to | ||
109 | -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is | ||
110 | -- the name of the parser) | ||
111 | -- list of language that will be disabled | ||
112 | disable = function(_, buf) | ||
113 | local max_filesize = 100 * 1024 -- 100 KB | ||
114 | local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) | ||
115 | if ok and stats and stats.size > max_filesize then | ||
116 | return true | ||
117 | end | ||
118 | end, | ||
119 | -- Setting this to true will run `:h syntax` and tree-sitter at the same time. | ||
120 | -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | ||
121 | -- Using this option may slow down your editor, and you may see some duplicate highlights. | ||
122 | -- Instead of true it can also be a list of languages | ||
123 | additional_vim_regex_highlighting = false, | ||
124 | }, | ||
125 | } | ||
15 | 126 | ||
16 | -- vim.o.shadafile = "/tmp/shada" | 127 | -- vim.wo.foldtext = 'v:lua.vim.treesitter.foldtext()' -- not available yet in my installation |
128 | vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' | ||
129 | vim.wo.foldlevel = 1 | ||
17 | 130 | ||
18 | -- only on Linux... | 131 | require('telescope').load_extension('media_files') |
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 | 132 | ||
25 | require'colorizer'.setup() | 133 | vim.lsp.set_log_level 'error' |
134 | if vim.fn.has 'nvim-0.5.1' == 1 then | ||
135 | require('vim.lsp.log').set_format_func(vim.inspect) | ||
136 | end | ||
137 | require'nvim-web-devicons'.setup { | ||
138 | color_icons = true; | ||
139 | default = true; | ||
140 | strict = true; | ||
141 | } | ||
142 | require('colorizer').setup() | ||
143 | require('gitsigns').setup() | ||
144 | require('trouble').setup() | ||
145 | require('neodev').setup() | ||
26 | 146 | ||
27 | -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. | 147 | local builtin = require('telescope.builtin') |
28 | require('cmp_nvim_lsp').setup{} | 148 | vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) |
29 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | 149 | vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) |
150 | vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) | ||
151 | vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) | ||
30 | 152 | ||
153 | vim.keymap.set({"i", "s"}, "<leader><Tab>", function() require('luasnip').jump(1) end, {silent = true}) | ||
154 | vim.keymap.set({"i", "s"}, "<leader><S-Tab>", function() require('luasnip').jump(-1) end, {silent = true}) | ||
31 | 155 | ||
32 | local cmp = require('cmp'); | 156 | local cmp = require'cmp' |
33 | cmp.setup({ | 157 | cmp.setup({ |
34 | snippet = { | 158 | snippet = { |
35 | -- REQUIRED - you must specify a snippet engine | 159 | -- REQUIRED - you must specify a snippet engine |
36 | expand = function(args) | 160 | expand = function(args) |
37 | vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. | 161 | require('luasnip').lsp_expand(args.body) -- For `luasnip` users. |
38 | -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | 162 | -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) |
39 | -- require('snippy').expand_snippet(args.body) -- For `snippy` users. | ||
40 | -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. | ||
41 | end, | 163 | end, |
42 | }, | 164 | }, |
43 | window = { | 165 | window = { |
@@ -47,34 +169,13 @@ cmp.setup({ | |||
47 | mapping = cmp.mapping.preset.insert({ | 169 | mapping = cmp.mapping.preset.insert({ |
48 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), | 170 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), |
49 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | 171 | ['<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(), | 172 | ['<C-Space>'] = cmp.mapping.complete(), |
53 | ['<C-e>'] = cmp.mapping.abort(), | 173 | ['<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. | 174 | ['<CR>'] = cmp.mapping.confirm({ select = true }), -- 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 | }), | 175 | }), |
63 | sources = cmp.config.sources({ | 176 | sources = cmp.config.sources({ |
64 | { name = 'nvim_lsp' }, | 177 | { name = 'nvim_lsp' }, |
65 | { name = 'vsnip' }, -- For vsnip users. | 178 | { name = 'luasnip' }, -- For luasnip 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. | ||
75 | cmp.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 | }, { | 179 | }, { |
79 | { name = 'buffer' }, | 180 | { name = 'buffer' }, |
80 | }) | 181 | }) |
@@ -82,75 +183,88 @@ cmp.setup.filetype('gitcommit', { | |||
82 | 183 | ||
83 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). | 184 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). |
84 | cmp.setup.cmdline({ '/', '?' }, { | 185 | cmp.setup.cmdline({ '/', '?' }, { |
85 | -- mapping = cmp.mapping.preset.cmdline(), | 186 | mapping = cmp.mapping.preset.cmdline({ |
86 | sources = { | 187 | ['<Down>'] = { c = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }) }, |
87 | { name = 'buffer' } | 188 | ['<Up>'] = { c = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }) }, |
88 | } | 189 | }), |
190 | sources = {{ name = 'buffer' }} | ||
89 | }) | 191 | }) |
90 | 192 | ||
91 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). | 193 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). |
92 | cmp.setup.cmdline(':', { | 194 | cmp.setup.cmdline(':', { |
93 | -- mapping = cmp.mapping.preset.cmdline(), | 195 | mapping = cmp.mapping.preset.cmdline({ |
94 | sources = cmp.config.sources({ | 196 | ['<Down>'] = { c = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }) }, |
95 | { name = 'cmdline' } | 197 | ['<Up>'] = { c = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }) }, |
96 | }) | 198 | }), |
199 | sources = cmp.config.sources( | ||
200 | {{ name = 'path' }}, | ||
201 | {{ name = 'cmdline' }} | ||
202 | ), | ||
203 | matching = { | ||
204 | disallow_symbol_nonprefix_matching = false, | ||
205 | disallow_partial_matching = false, | ||
206 | disallow_fullfuzzy_matching = false, | ||
207 | disallow_fuzzy_matching = false, | ||
208 | disallow_partial_fuzzy_matching = false, | ||
209 | disallow_prefix_unmatching = false, | ||
210 | } | ||
97 | }) | 211 | }) |
98 | 212 | ||
213 | -- Set up lspconfig. | ||
214 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | ||
99 | 215 | ||
100 | -- # Language Servers | 216 | -- # Language Servers |
101 | -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md | 217 | -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md |
102 | 218 | ||
103 | -- The following example advertise capabilities to `clangd`. | ||
104 | -- C/C++ | clang | 219 | -- C/C++ | clang |
105 | require('lspconfig')['clangd'].setup{capabilities = capabilities} | 220 | require('lspconfig')['clangd'].setup{capabilities = capabilities} |
106 | 221 | -- lua (but not init.lua entirely, hence why neodev) | |
222 | require('lspconfig')['lua_ls'].setup { capabilities = capabilities } | ||
223 | -- 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 } | ||
224 | require'lspconfig'.jdtls.setup{} | ||
107 | -- bash | bash-language-server | 225 | -- bash | bash-language-server |
108 | require('lspconfig')['bashls'].setup{capabilities = capabilities} | 226 | require('lspconfig')['bashls'].setup{capabilities = capabilities} |
109 | |||
110 | -- ccs | vscode-css-languageserver | 227 | -- ccs | vscode-css-languageserver |
111 | require('lspconfig')['cssls'].setup{capabilities = capabilities} | 228 | require('lspconfig')['cssls'].setup{capabilities = capabilities} |
112 | |||
113 | -- rust | rust-analyzer | 229 | -- rust | rust-analyzer |
114 | require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities} | 230 | require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities} |
115 | |||
116 | -- javascript | eslint | 231 | -- javascript | eslint |
117 | require('lspconfig')['eslint'].setup{capabilities = capabilities} | 232 | require('lspconfig')['eslint'].setup{capabilities = capabilities} |
118 | |||
119 | -- javascript | typescript-language-server | 233 | -- javascript | typescript-language-server |
120 | require('lspconfig')['tsserver'].setup{capabilities = capabilities} | 234 | require('lspconfig')['tsserver'].setup{capabilities = capabilities} |
121 | |||
122 | -- vimscript | vim-language-server | 235 | -- vimscript | vim-language-server |
123 | require('lspconfig')['vimls'].setup{capabilities = capabilities} | 236 | require('lspconfig')['vimls'].setup{capabilities = capabilities} |
124 | 237 | -- html | |
125 | require('lspconfig')['html'].setup{capabilities = capabilities} | 238 | require('lspconfig')['html'].setup{capabilities = capabilities} |
126 | 239 | -- jsonls | |
127 | require('lspconfig')['jsonls'].setup{capabilities = capabilities} | 240 | require('lspconfig')['jsonls'].setup{capabilities = capabilities} |
128 | |||
129 | -- C/C++ | clang | 241 | -- C/C++ | clang |
130 | require('lspconfig')['clangd'].setup{capabilities = capabilities} | 242 | require('lspconfig')['clangd'].setup{capabilities = capabilities} |
131 | |||
132 | -- bash | bash-language-server | 243 | -- bash | bash-language-server |
133 | require('lspconfig')['bashls'].setup{capabilities = capabilities} | 244 | require('lspconfig')['bashls'].setup{capabilities = capabilities} |
134 | |||
135 | -- ccs | vscode-css-languageserver | 245 | -- ccs | vscode-css-languageserver |
136 | require('lspconfig')['cssls'].setup{capabilities = capabilities} | 246 | require('lspconfig')['cssls'].setup{capabilities = capabilities} |
137 | |||
138 | -- rust | rust-analyzer | 247 | -- rust | rust-analyzer |
139 | require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities} | 248 | require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities} |
140 | |||
141 | -- javascript | eslint | 249 | -- javascript | eslint |
142 | require('lspconfig')['eslint'].setup{capabilities = capabilities} | 250 | require('lspconfig')['eslint'].setup{capabilities = capabilities} |
143 | |||
144 | -- javascript | typescript-language-server | 251 | -- javascript | typescript-language-server |
145 | require('lspconfig')['tsserver'].setup{capabilities = capabilities} | 252 | require('lspconfig')['tsserver'].setup{capabilities = capabilities} |
146 | |||
147 | -- vimscript | vim-language-server | 253 | -- vimscript | vim-language-server |
148 | require('lspconfig')['vimls'].setup{capabilities = capabilities} | 254 | require('lspconfig')['vimls'].setup{capabilities = capabilities} |
149 | 255 | -- configure html server | |
150 | require('lspconfig')['html'].setup{capabilities = capabilities} | 256 | require('lspconfig')["html"].setup({ |
151 | 257 | capabilities = capabilities, | |
152 | require('lspconfig')['jsonls'].setup{capabilities = capabilities} | 258 | -- on_attach = on_attach, |
153 | 259 | init_options = { | |
260 | configurationSection = { "html", "css", "javascript" }, | ||
261 | embeddedLanguages = { | ||
262 | css = true, | ||
263 | javascript = true, | ||
264 | }, | ||
265 | provideFormatter = true, | ||
266 | }, | ||
267 | }) | ||
154 | require('lspconfig')['pylsp'].setup{ | 268 | require('lspconfig')['pylsp'].setup{ |
155 | settings = { | 269 | settings = { |
156 | pylsp = { | 270 | pylsp = { |
@@ -164,50 +278,4 @@ require('lspconfig')['pylsp'].setup{ | |||
164 | } | 278 | } |
165 | } | 279 | } |
166 | 280 | ||
167 | -- lua | ||
168 | require('lspconfig')['lua_ls'].setup{ | ||
169 | settings = { | ||
170 | Lua = { | ||
171 | diagnostics = { | ||
172 | globals = { 'vim', 'require', 'cmp' } | ||
173 | } | ||
174 | } | ||
175 | } | ||
176 | } | ||
177 | |||
178 | |||
179 | require'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 | ||
209 | vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' | ||
210 | vim.wo.foldlevel = 1 | ||
211 | |||
212 | |||
213 | -- vim: tabstop=2 shiftwidth=2 softtabstop=2 | 281 | -- vim: tabstop=2 shiftwidth=2 softtabstop=2 |
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 @@ | |||
1 | command! LspFix lua vim.lsp.buf.code_action() | ||
diff --git a/plugin/max-find-shell.vim b/plugin/max-find-shell.vim deleted file mode 100644 index 778f0fb..0000000 --- a/plugin/max-find-shell.vim +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | "======================================================================================================================= | ||
2 | " SHELL: | ||
3 | " Many scripts rely on bash. We help to find the bash binary | ||
4 | "======================================================================================================================= | ||
5 | if filereadable("/bin/bash") | ||
6 | set shell=/bin/bash | ||
7 | elseif filereadable("/usr/local/bin/bash") | ||
8 | set shell=/usr/local/bin/bash | ||
9 | elseif has("win32") | ||
10 | set shell="cmd.exe" | ||
11 | endif | ||
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 | "======================================================================================================================= | ||
4 | function! 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*$/ | ||
40 | endfunction | ||
41 | autocmd ColorScheme * call ExtendColorTheme() | ||
42 | |||
43 | if &term == "linux" | ||
44 | set notermguicolors | ||
45 | else | ||
46 | set termguicolors | ||
47 | endif | ||
48 | |||
49 | |||
50 | let 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 | |||
61 | set background=dark | ||
62 | colorscheme 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 | |||
3 | augroup 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" | ||
21 | augroup 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 @@ | |||
1 | augroup 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 | ||
16 | augroup 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 @@ | |||
1 | if &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 | ||
4 | endif | ||
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 @@ | |||
1 | augroup 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 | ||
19 | augroup 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 | |||
4 | urxvt.scrollBar: false | ||
5 | urxvt.background: base00 | ||
6 | urxvt.color0: base00 | ||
7 | urxvt.color1: base00 | ||
8 | urxvt.color2: base00 | ||
9 | urxvt.color3: base00 | ||
10 | urxvt.color4: base00 | ||
11 | urxvt.color5: base00 | ||
12 | urxvt.color6: base00 | ||
13 | urxvt.color7: base00 | ||
14 | urxvt.color8: base00 | ||
15 | urxvt.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 | |||
28 | xscreensaver.logFile:/home/max/xscreensaver.log | ||
29 | xscreensaver.verbose:true | ||
30 | *.newLoginCommand: xset dpms force off | ||
31 | |||
32 | Xft.antialias: true | ||
33 | Xft.lcdfilter: lcddefault | ||
34 | Xft.hinting: true | ||
35 | Xft.rgba: rgb | ||
36 | Xft.hintstyle: hintfull | ||
37 | Xft.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 | |||
52 | xscreensaver.overlayTextForeground: #FFFF00 | ||
53 | xscreensaver.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 | |||
69 | XLock*mode: image | ||
70 | *image.bitmap: /home/max/.lock.xpm | ||
71 | *image.count: 1 | ||
72 | *image.erasedelay: 0 | ||
73 | XLock*erasedelay: 0 | ||
74 | XLock*icongeometry: 180x180 | ||
75 | ! XLock*background: background | ||
76 | ! XLock*foreground: foreground | ||
77 | XLock*description: off | ||
78 | XLock*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.) | ||
92 | Ddd*background: #e0e0e0 | ||
93 | |||
94 | ! These had no effect on my system but, from what I read, they help on | ||
95 | ! some systems. | ||
96 | Ddd*enableThinThickness: True | ||
97 | Ddd*enableEtchedInMenu: True | ||
98 | Ddd*enableToggleColor: True | ||
99 | Ddd*enableToggleVisual: True | ||
100 | |||
101 | ! Use pure white for white backgrounds like modern widget themes and websites | ||
102 | Ddd*XmText.background: #ffffff | ||
103 | Ddd*XmTextField.background: #ffffff | ||
104 | Ddd*XmList.background: #ffffff | ||
105 | Ddd*GraphEdit.background: #ffffff | ||
106 | |||
107 | ! Thick borders and shadows everywhere are archaic | ||
108 | Ddd*shadowThickness: 1 | ||
109 | Ddd*borderThickness: 0 | ||
110 | Ddd*?*arg*shadowThickness: 1 | ||
111 | Ddd*?*arg*borderThickness: 0 | ||
112 | Ddd*?*buttons*shadowThickness: 1 | ||
113 | Ddd*?*buttons*borderThickness: 0 | ||
114 | |||
115 | ! Un-cramp the menubar, menus, and toolbar to match modern compact sizing | ||
116 | Ddd*menubar*marginTop: 1 | ||
117 | Ddd*menubar*marginBottom: 0 | ||
118 | Ddd*XmMenuShell*marginTop: 2 | ||
119 | Ddd*XmMenuShell*marginBottom: 2 | ||
120 | Ddd*XmMenuShell.?.marginWidth: 2 | ||
121 | Ddd*XmMenuShell.?.marginHeight: 2 | ||
122 | Ddd*toolbar*marginWidth: 5 | ||
123 | |||
124 | ! Compact the menu tear-off buttons | ||
125 | Ddd*XmMenuShell*XmTearOffButton*borderWidth: 0 | ||
126 | Ddd*XmMenuShell*XmTearOffButton*marginHeight: 0 | ||
127 | |||
128 | ! DDD's interpretation of a "toggle button" shouldn't have a raised border | ||
129 | Ddd*XmToggleButton*shadowThickness: 0 | ||
130 | Ddd*XmToggleButton*borderThickness: 0 | ||
131 | |||
132 | ! The menu bar should not have a raised border | ||
133 | Ddd*menubar.shadowThickness: 0 | ||
134 | Ddd*menubar.borderThickness: 0 | ||
135 | Ddd*XmMenuShell*XmTearOffButton*ShadowThickness: 2 | ||
136 | |||
137 | ! ...and we do not want a border around the toolbar to make that stand out | ||
138 | Ddd*main_window.?.borderThickness: 0 | ||
139 | Ddd*main_window.shadowThickness: 0 | ||
140 | |||
141 | ! Drop-down boxes in toolbars do not have raised borders these days | ||
142 | Ddd*toolbar.shadowThickness: 0 | ||
143 | Ddd*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 | ||
147 | Ddd*cutCopyPasteBindings: KDE | ||
148 | Ddd*selectAllBindings: KDE | ||
149 | Ddd*buttonColorKey: c | ||
150 | Ddd*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 | |||
181 | XTerm.vt100.faceName: Monospace:antialias=true | ||
182 | XTerm.vt100.faceSize: 12 | ||
183 | ! XTerm.vt100.font: 7x14 | ||
184 | XTerm.vt100.locale: true | ||
185 | XTerm.vt100.utf8Title: true | ||
186 | |||
187 | |||
188 | ! keepassx colourscheme | ||
189 | keepassx*background: #cfcfcf | ||
190 | keepassx*foreground: #222222 | ||
191 | keepassx2*background: #cfcfcf | ||
192 | keepassx2*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] | ||
2 | Type=Application | ||
3 | Name=Gnome Vi IMproved Buffer | ||
4 | Icon=gvim | ||
5 | Comment=Open file in an existing instance of vi and in a new tab | ||
6 | MimeType=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++; | ||
7 | Exec=gvim -f -N --remote-silent %F | ||
8 | Terminal=false | ||
9 | X-XClassHintResName=VIM | ||
10 | Categories=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] | ||
2 | Name=Vi IMproved Tab | ||
3 | Comment=Open file in an existing instance of vi and in a new tab | ||
4 | MimeType=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++; | ||
5 | Exec=gvim f -N --remote-tab %F | ||
6 | Icon=gvim | ||
7 | Type=Application | ||
8 | Terminal=false | ||
9 | X-XClassHintResName=VIM | ||
10 | Categories=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] | ||
2 | Version=1.0 | ||
3 | Type=Application | ||
4 | Name=Vim | ||
5 | Comment= | ||
6 | Exec=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 | ||
7 | Icon=/usr/share/icons/HighContrast/256x256/apps/vim.png | ||
8 | Path= | ||
9 | Terminal=false | ||
10 | StartupNotify=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] | ||
2 | Version=1.0 | ||
3 | Type=Application | ||
4 | Name=Vi IMproved | ||
5 | Comment=Open file in an existing instance of vi and in a new tab | ||
6 | Icon=gvim | ||
7 | MimeType=text/* | ||
8 | Categories=Application;Utility;TextEditor; | ||
9 | Exec=vim %F | ||
10 | Terminal=true | ||
11 | Actions=Server; | ||
12 | |||
13 | [Desktop Action Server] | ||
14 | Exec=vim --servername VIM --remote-silent %F | ||
15 | Name=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" -' | ||
13 | export 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 | |||
21 | git config --global --replace-all color.pager 0 | ||
22 | git 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 | |||
32 | function 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 | |||
44 | menu menuitem:backdrop, menu menuitem:backdrop:hover | ||
45 | { | ||
46 | border:0px; | ||
47 | } | ||
48 | */ | ||
49 | |||
50 | |||
51 | |||
52 | window#vim-main-window > box | ||
53 | { | ||
54 | background: currentColor; | ||
55 | border:2px solid transparent; | ||
56 | } | ||
57 | |||
58 | /* within window > box ... */ | ||
59 | menubar#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 | |||
67 | menubar#vim-menubar menuitem { | ||
68 | background:transparent; | ||
69 | color:mix(currentColor,#fff,0.5); | ||
70 | } | ||
71 | |||
72 | |||
73 | |||
74 | menubar#vim-menubar > menuitem { | ||
75 | padding:.25em; | ||
76 | } | ||
77 | |||
78 | menubar#vim-menubar > menuitem:disabled accelerator | ||
79 | { | ||
80 | color:#f00; | ||
81 | } | ||
82 | |||
83 | menubar#vim-menubar menuitem box { | ||
84 | padding:.1em .25em; | ||
85 | } | ||
86 | |||
87 | menubar#vim-menubar menuitem window | ||
88 | { | ||
89 | margin-top:1em; | ||
90 | } | ||
91 | |||
92 | /* opened menu (after being clicked) */ | ||
93 | menubar#vim-menubar menuitem window menu { | ||
94 | background:lighter(currentColor); | ||
95 | padding:0; | ||
96 | margin:0; | ||
97 | border:0; | ||
98 | } | ||
99 | |||
100 | menubar#vim-menubar menuitem window menu menuitem { | ||
101 | padding:0em; | ||
102 | margin:0px; | ||
103 | border:0px; | ||
104 | } | ||
105 | |||
106 | menubar#vim-menubar menuitem window menu menuitem box { | ||
107 | padding:.25em; | ||
108 | padding-left:.5em; | ||
109 | } | ||
110 | |||
111 | menubar#vim-menubar menuitem window menu separator { | ||
112 | margin:0; | ||
113 | background:currentColor; | ||
114 | border-top:1px dotted #666; | ||
115 | } | ||
116 | |||
117 | |||
118 | menubar#vim-menubar menuitem:hover { | ||
119 | box-shadow:none; | ||
120 | background:darker(currentColor); | ||
121 | color:#fff; | ||
122 | } | ||
123 | |||
124 | |||
125 | |||
126 | |||
127 | |||
128 | |||
129 | /* | ||
130 | toolbar button { | ||
131 | notebook 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 @@ | |||
1 | gtk-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 @@ | |||
1 | LANG=de_DE.utf8 | ||
2 | LC_CTYPE=de_DE.utf8 | ||
3 | LC_NUMERIC=de_DE.utf8 | ||
4 | LC_TIME=de_DE.utf8 | ||
5 | LC_COLLATE=C | ||
6 | LC_MONETARY=de_DE.utf8 | ||
7 | LC_MESSAGES=de_DE.utf8 | ||
8 | LC_PAPER=de_DE.utf8 | ||
9 | LC_NAME=de_DE.utf8 | ||
10 | LC_ADDRESS=de_DE.utf8 | ||
11 | LC_TELEPHONE=de_DE.utf8 | ||
12 | LC_MEASUREMENT=de_DE.utf8 | ||
13 | LC_IDENTIFICATION=de_DE.utf8 | ||
14 | LC_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 @@ | |||
1 | git 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 | ||
2 | run_im ibus | ||
3 | # im-config signature: ec6901ebc5d2dcf71d14062c6968658e - | ||
@@ -1,33 +1,389 @@ | |||
1 | exec ':source '.fnamemodify($MYVIMRC,':h').'/'.'vimrc-common' | 1 | "======================================================================================================================= |
2 | set packpath+=pack/submodules | 2 | " GENERAL |
3 | "======================================================================================================================= | ||
3 | 4 | ||
4 | if has("nvim") | 5 | filetype on |
5 | set shadafile="/tmp/shada" | 6 | filetype plugin on |
7 | filetype indent on | ||
8 | |||
9 | syntax on | " enable syntax highlighting | ||
10 | syntax sync minlines=60 | " how many preceding lines will be parsed? (high performance impact) | ||
11 | |||
12 | set secure | " to ensure, that modelines do not contain executable code | ||
13 | set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins) | ||
14 | set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig) | ||
15 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against | ||
16 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis | ||
17 | set 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) | ||
18 | set 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 | ||
25 | set expandtab | " replace tabs with spaces | ||
26 | set textwidth=0 | " should be set file type specific, colorcolumns is there to assist anyways | ||
27 | set tabstop=4 | ||
28 | set shiftwidth=4 | ||
29 | set softtabstop=4 | ||
30 | |||
31 | "======================================================================================================================= | ||
32 | " PATH -- where to search for includes (e.g. `gf` or `:find`) | ||
33 | "======================================================================================================================= | ||
34 | set path+=**4 | " allow recursive searches for files (limit depth by 4) | ||
35 | if executable("uname") " does not work under Windows | ||
36 | let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | ||
37 | endif | ||
38 | |||
39 | if filereadable("/bin/bash") | ||
40 | set shell=/bin/bash | ||
41 | elseif filereadable("/usr/local/bin/bash") | ||
42 | set shell=/usr/local/bin/bash | ||
43 | elseif has("win32") | ||
44 | set shell="cmd.exe" | ||
45 | endif | ||
46 | |||
47 | " ====================================================================================================================== | ||
48 | " SETTINGS: | ||
49 | " ====================================================================================================================== | ||
50 | set breakindent | " Every wrapped line will continue visually indented | ||
51 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
52 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
53 | set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) | ||
54 | set confirm | " asks 'do you want to save?' | ||
55 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
56 | set hidden | " allows switching buffers even if the current buffer contains changes (displays +) | ||
57 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
58 | set mousemodel=popup | " only in gvim: right click opens a pop-up-menu | ||
59 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
60 | set noautochdir | " When on, Vim will change the current working directory | ||
61 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
62 | set nowrap | " but do not (by default) wrap long lines around | ||
63 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
64 | |||
65 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for | ||
66 | set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
67 | set scrolloff=4 | " keeps cursor centered | ||
68 | set shiftround | " indent/un-indent snaps to multiple of shiftwidths | ||
69 | set writedelay=0 | ||
70 | |||
71 | " display and performance | ||
72 | set lazyredraw | " disables redraw during macro execution (improves performance, but causes problems with solid backgrounds) | ||
73 | set cmdheight=2 | " sets the command line's height | ||
74 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | ||
75 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
76 | set updatetime=80 | " updates the screen more often | ||
77 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | ||
78 | set notimeout | " improves performance but is known to cause problems on slow terminals | ||
79 | set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- | ||
80 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
81 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | ||
82 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. | ||
83 | set wildmenu | " use a menu in the command line | ||
84 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
85 | |||
86 | " code completion | ||
87 | " set dictionary=/usr/share/dict/cracklib-small | ||
88 | set isfname-== | " remove = as char in filenames, because most FSs do not support it | ||
89 | set complete+=d | " scan current and included files for defined name or macro | ||
90 | set complete+=i | " scan current and included files for completions | ||
91 | set complete+=k | " make default completer <C-N> respect the dictionary | ||
92 | set complete-=u | " scan current and included files | ||
93 | set complete+=i | " scan current and included files | ||
94 | set complete+=d | " scan current and included files for defined name or macro | ||
95 | " set complete=d | " scan current and included files for defined name or macro | ||
96 | set completeopt+=noinsert | " Do not insert any text for a match until the user selects one | ||
97 | set completeopt+=noselect | " Do not select a completion from the menu, let the user do that | ||
98 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] | ||
99 | set tags+=../tags | ||
100 | |||
101 | " code folding... | ||
102 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) | ||
103 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
104 | set foldcolumn=0 | " I think I don't need this second indicator | ||
105 | " set numberwidth=5 | ||
106 | " set foldmethod=syntax | " foldlevel: syntax, indent, manual / foldmethod=syntax makes Vim incredible slow | ||
107 | set foldnestmax=1 | " top level folding only | ||
108 | set foldopen=block,hor,search | " when do we unfold? | ||
109 | " set foldtext=printf('%*s%.*S',indent(v:foldstart),'',&textwidth-indent(v:foldstart),substitute(substitute(join(getline(v:foldstart,v:foldend),'\ '),'[[:space:]*/]\\+','\ ','g'),'^[[:space:]*]','','g')) | ||
110 | set foldtext=repeat('\ ',indent(v:foldstart)-1).join(getline(v:foldstart,v:foldend))[:winwidth(0)]->substitute('[[:space:]]\\+','\ ','g') | ||
111 | |||
112 | " works ... | ||
113 | " set foldexpr=match(synIDattr(synID(v:lnum,indent(v:lnum)+1,0),'name'),'Comment')>-1 | ||
114 | set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1})) | ||
115 | |||
116 | " vim window behaviour | ||
117 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
118 | set splitright | " this also works for me and makes better use of the scren space I think | ||
119 | set winminwidth=0 | " (and all other windows, so TODO: watch out) | ||
120 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
121 | |||
122 | " vim session handling and restore behaviour | ||
123 | set viminfo+=% | " restore buffer list | ||
124 | set sessionoptions= | ||
125 | set sessionoptions+=buffers | ||
126 | set sessionoptions+=curdir | ||
127 | set sessionoptions+=folds | ||
128 | set sessionoptions+=resize | ||
129 | set sessionoptions+=slash | ||
130 | set sessionoptions+=tabpages | ||
131 | set sessionoptions+=unix | ||
132 | set sessionoptions+=winpos | ||
133 | set sessionoptions+=winsize | ||
134 | |||
135 | " set nocindent smartindent | " use smart indent rather then cindent | ||
136 | set noautoindent | ||
137 | set nosmartindent | ||
138 | |||
139 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths | ||
140 | set noequalalways | " do not evenly size windows when opening new or closing old | ||
141 | set nocursorline | " turn visual cursor line off (improves performance) | ||
142 | |||
143 | "======================================================================================================================= | ||
144 | " SPELL_CHECKING: | ||
145 | "======================================================================================================================= | ||
146 | let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' | ||
147 | " add local user default spell file as primary source for words | ||
148 | let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" | ||
149 | |||
150 | set nospell | " disable spell checker by default | ||
151 | set spelllang=en,de | " languages for the spell checker | ||
152 | set spellsuggest=10 | " how many words will z= suggest? | ||
153 | set thesaurus+=~/.vim/thesaurus/php.txt | ||
154 | |||
155 | if &diff " only for diff mode/vimdiff | ||
156 | set diffopt=filler,context:1000000 " filler is default and inserts empty lines for sync | ||
157 | set foldmethod=syntax | ||
158 | endif | ||
159 | |||
160 | "======================================================================================================================= | ||
161 | " UNDO: | ||
162 | " Persistent undo behaviour, also keeps undo history between starts | ||
163 | "======================================================================================================================= | ||
164 | if has('persistent_undo') | ||
165 | if isdirectory('/dev/shm') | ||
166 | set undodir=/dev/shm/ | " save undo file in memory. That is volatile, but fast and we have GIT for longer lasting undoes | ||
167 | set directory=/dev/shm/ | " swap file directory to RAM | ||
168 | set swapfile | ||
169 | elseif isdirectory('/tmp/') | ||
170 | set undodir=/tmp/ | ||
171 | endif | ||
172 | set undofile | " preserve undo history when closing and reopening buffers (see :help undo-persistence) | ||
6 | endif | 173 | endif |
7 | 174 | ||
8 | if exists("g:neovide") | 175 | |
9 | " neovide specific | 176 | "======================================================================================================================= |
10 | set guifont=monospace:h11:b | 177 | " DISPLAY & MULTI_BYTE |
11 | " :#e-subpixelantialias:#h-full | 178 | "======================================================================================================================= |
12 | let g:neovide_cursor_animation_length=0.03 | 179 | if has("multi_byte") |
13 | let g:neovide_cursor_trail_size=0.8 | 180 | scriptencoding utf-8 | " tell vim that we are using UTF-8 here |
14 | let g:neovide_scroll_animation_length = 0.05 | 181 | set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) |
15 | let g:neovide_transparency = 0.9 | 182 | set termencoding=utf-8 | " we just assume that this is supported. |
183 | |||
184 | set fillchars= | " initialize empty fillchars | ||
185 | set listchars= | " initialize empty listchars | ||
186 | |||
187 | if &term ==# 'linux' | ||
188 | set fillchars+=vert:\│ | " cool vertical split char | ||
189 | else | ||
190 | set fillchars+=vert:\║ | " cool vertical split char | ||
191 | endif | ||
192 | |||
193 | set fillchars+=fold:\ | " | ||
194 | set fillchars+=diff:\ | " a white space gets used here | ||
195 | |||
196 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | ||
197 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | ||
198 | |||
199 | set listchars+=tab:▏\ | " | ||
200 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | ||
201 | " set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | ||
202 | " set listchars+=space:⸳ | " · | " symbols used when using :set list (which displays non-printable chars) | ||
203 | set showbreak+=› | " symbol used in the beginning of a wrapped line | ||
204 | |||
205 | " automatically enter list mode when going in insert mode (makes above syntax command temporarily ineffective) | ||
206 | set nolist | ||
207 | |||
208 | autocmd InsertEnter * set list | ||
209 | autocmd InsertLeave * set list& | ||
210 | |||
211 | autocmd InsertEnter * set colorcolumn=80,120 | ||
212 | autocmd InsertLeave * set colorcolumn& | ||
213 | " set fillchars+=stlnc:\― | " | ||
214 | end | ||
215 | |||
216 | |||
217 | "======================================================================================================================= | ||
218 | " AUTOCMDs and FileType specific stuff | ||
219 | "======================================================================================================================= | ||
220 | if has("autocmd") | ||
221 | " use the shada/viminfo file to return the cursor to where it was... | ||
222 | autocmd BufWinEnter * if &previewwindow | setlocal nonumber nolist signcolumn=no filetype=c nobuflisted | endif | ||
223 | |||
224 | " Workaround: Allows Vim to yank text within wayland | ||
225 | " XDG_SESSION_TYPE is only set if a login manager was used | ||
226 | " WAYLAND_DISPLAY should always work | ||
227 | " if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) && !has('nvim') | ||
228 | " autocmd TextYankPost * call system("wl-copy", getreg('+')) | ||
229 | " endif | ||
230 | |||
231 | autocmd TextYankPost * echo '> text yanked to '. | ||
232 | \ (get(v:event,'regname') == '' | ||
233 | \ ? 'default register' | ||
234 | \ : 'register '.get(v:event,'regname')) | ||
235 | |||
236 | |||
237 | autocmd InsertLeave * silent! call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) | ||
238 | autocmd InsertEnter * silent! call matchdelete(101) | ||
239 | |||
240 | |||
241 | "==================================================================================================================== | ||
242 | augroup FILETYPES | ||
243 | " indent within <script> and <style> (default is a zero indent) | ||
244 | let g:html_indent_script1 = "inc" | ||
245 | let g:html_indent_style1 = "inc" | ||
246 | |||
247 | " let g:loaded_ruby_provider = 1 " disable ruby support | ||
248 | " let g:loaded_python_provider = 1 " disable python 3 | ||
249 | |||
250 | let g:LatexBox_latexmk_preview_continuously = 1 | ||
251 | let g:LatexBox_viewer = "evince" | ||
252 | |||
253 | autocmd FileType python setlocal keywordprg=pydoc | ||
254 | autocmd FileType vim setlocal keywordprg=:help |. | ||
255 | autocmd FileType conf setlocal isfname-== | ||
256 | autocmd Filetype css command! CSSsort :g/{/+1;/}/-1 sort | ||
257 | autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O> | ||
258 | |||
259 | autocmd Filetype html,htmldjango,xml | ||
260 | \ :nnoremap | ||
261 | \ <M-Down> | ||
262 | \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>| | ||
263 | \ :nnoremap | ||
264 | \ <M-Up> | ||
265 | \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>| | ||
266 | \ :nnoremap | ||
267 | \ <leader>= | ||
268 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | ||
269 | augroup END | ||
16 | endif | 270 | endif |
17 | 271 | ||
18 | " if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) | 272 | " ====================================================================================================================== |
19 | " autocmd TextYankPost * call system("wl-copy", get(v:event, 'regcontents')) | 273 | augroup CUSTOM_COMMANDS |
20 | " nnoremap p :silent put =system('wl-paste')<CR> | 274 | 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"))}') }) |
21 | " nnoremap P :silent put! =system('wl-paste')<CR> | 275 | command! Ctoggle |
22 | " endif | 276 | \ if(get(getqflist({'winid':1}), 'winid') == win_getid())|cclose|else|botright copen|endif |
23 | 277 | command! Ltoggle | |
24 | " scripts from the default vim installation, which do not get loaded by default, but are useful. | 278 | \ if(get(getloclist(0, {'winid':1}), 'winid') == win_getid())|lclose|else|lopen|endif |
25 | " if filereadable($VIMRUNTIME.'/macros/editexisting.vim') | 279 | command! BuffersToArg :exec ':args '.join(map(range(0, bufnr('$')), 'fnameescape(fnamemodify(bufname(v:val), ":."))')) |
26 | " packadd! editexisting | 280 | command! BufToArg :argadd %:. |
27 | " endif | 281 | command! Gbranch call setqflist([], 'r', {'title':'Git branch selector','items':map(systemlist("git branch"), {_, p->{'filename':'branch','module': fnamemodify(p, ':.')}})}) |
28 | " | 282 | " the following command opens a preview-window and shows the declaration of |
29 | " " load default plugin 'matchit' to allow % to jump between tags | 283 | " the function under the cursor. It also highlights the word to make it easier |
30 | " if filereadable($VIMRUNTIME.'/macros/matchit.vim') | 284 | " to spot within a great file |
31 | " packadd! matchit | 285 | command! Helpme au! CursorHold * nested let @/=expand('<cword>')|exe "silent! psearch ".expand("<cword>") |
32 | " endif | 286 | command! FindInAllBuffers cex [] | bufdo vimgrepadd //g % | cw |
33 | " | 287 | augroup END |
288 | |||
289 | "======================================================================================================================= | ||
290 | augroup KEYBOARD_MAPPING | ||
291 | " map CTRL-PageUp/Down to next/previous buffer | ||
292 | " and Shift-PageUp/Down to next/previous arglist file | ||
293 | nnoremap <C-PageUp> :bn<CR> | ||
294 | nnoremap <C-PageDown> :bp<CR> | ||
295 | nnoremap <S-PageUp> :N<CR> | ||
296 | nnoremap <S-PageDown> :n<CR> | ||
297 | |||
298 | nnoremap <F4> :wincmd c<CR> | ||
299 | nnoremap <F5> :make!<CR> | ||
300 | nnoremap <F6> :silent syntax sync fromstart<CR>:nohlsearch<CR>:silent match<CR>:silent 2match<CR>:silent 3match<CR> | ||
301 | nnoremap <F7> :Ltoggle<CR> | ||
302 | nnoremap <F8> :Ctoggle<CR> | ||
303 | nnoremap <F9> :TagbarToggle<CR> | ||
304 | "" remap <..> | ||
305 | nnoremap <F12> :Qfls<CR>:Ctoggle<CR> | ||
306 | |||
307 | " close current buffer with <leader>q... | ||
308 | nnoremap <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>. | ||
309 | nnoremap <leader>r :syntax sync fromstart | ||
310 | |||
311 | nnoremap <silent> <A-Up> :wincmd k<CR> | ||
312 | nnoremap <silent> <A-Down> :wincmd j<CR> | ||
313 | nnoremap <silent> <A-Left> :wincmd h<CR> | ||
314 | nnoremap <silent> <A-Right> :wincmd l<CR> | ||
315 | |||
316 | |||
317 | inoremap <C-S> <C-O>:w<CR> | ||
318 | |||
319 | " exec current line as a command, insert output of command (from: https://youtu.be/MquaityA1SM?t=35m45s) | ||
320 | nnoremap <leader>Q !!$SHELL<CR> | ||
321 | " google the word under the cursor | ||
322 | nnoremap <leader>g :execute ":!xdg-open https://google.de/search?q=".expand("<cword>")<CR> | ||
323 | nnoremap <leader>u :execute ":!xdg-open ".expand("<cWORD>")<CR> | ||
324 | " display highlight group under the cursor | ||
325 | nnoremap <leader>h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR> | ||
326 | |||
327 | |||
328 | " ====================================================================================================================== | ||
329 | " SHORTCUTS: custom shortcuts | ||
330 | " inoremap <C-Space> <C-x><C-o> | ||
331 | " inoremap <C-@> <C-Space> | ||
332 | |||
333 | " Bind CTRL+Backspace to vim's version (CTRL+W) in " <CR> insert mode (only works with gvim) | ||
334 | inoremap <C-Backspace> <C-W> | ||
335 | |||
336 | " INDENTATION: allows un-indenting a selected block and keeps selection | ||
337 | vnoremap < <gv | ||
338 | vnoremap > >gv | ||
339 | |||
340 | " make shift-home select to the beginning of the line | ||
341 | nnoremap <s-home> v^ | ||
342 | nnoremap <s-end> v$ | ||
343 | |||
344 | nnoremap <s-down> vj | ||
345 | vnoremap <s-down> j | ||
346 | nnoremap <s-up> vk | ||
347 | vnoremap <s-up> k | ||
348 | |||
349 | " if the wildmenu is configured to to display suggestions vertically, then | ||
350 | " reconfigure the cursor keys to work in that direction | ||
351 | if &wildoptions =~# 'pum' | ||
352 | cnoremap <expr> <up> pumvisible() ? "<C-p>" : "\<up>" | ||
353 | cnoremap <expr> <down> pumvisible() ? "<C-n>" : "\<down>" | ||
354 | endif | ||
355 | |||
356 | |||
357 | " INSERT_MODE_MAPPINGS: | ||
358 | " default copy&paste insert key binding (just in insert mode, so it doesn't conflict | ||
359 | " with visual block mode)- would have been nice, but collides with c-w for digraphs | ||
360 | " inoremap <C-V> <C-R>+ | ||
361 | |||
362 | " NEOVIM_SPECIFIC: | ||
363 | if has('nvim') " only neovim... | ||
364 | " shortcut \t opens a terminal in a horizontal split | ||
365 | nnoremap <leader>t :new +terminal<CR> | ||
366 | endif | ||
367 | augroup END | ||
368 | |||
369 | augroup NETRW | ||
370 | " Deprecated with this configuration, but still useful when deactivating some Plugins | ||
371 | " NETRW: obsolete with NERDTree | ||
372 | let g:netrw_alto = 0 | " open files on the right | ||
373 | let g:netrw_altv = 1 | " open files on the right | ||
374 | let g:netrw_banner = 0 | " display help messages? | ||
375 | let g:netrw_browse_split = 4 | " 4=open in previous window | ||
376 | let g:netrw_fastbrowse = 2 | " manually refresh direcory list (avoids display errors) | ||
377 | let g:netrw_hide = 1 | " show not-hidden files only | ||
378 | let g:netrw_keepdir = 1 | " because that works better, when gf finds a path name | ||
379 | let g:netrw_list_hide = '^\..*' | " Explore mode: hide files starting with dot | ||
380 | let g:netrw_liststyle = 3 | " 3=tree | ||
381 | let g:netrw_preview = 0 | " | ||
382 | let g:netrw_winsize = 20 | " window size in percent | ||
383 | " let s:treedepthstring = "│ " | " this is not going to work, but left here for documentation | ||
384 | augroup END | ||
385 | |||
386 | |||
387 | "======================================================================================================================= | ||
388 | " v modeline, do not chnage v | ||
389 | " 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 | |||
5 | filetype on | ||
6 | filetype plugin on | ||
7 | filetype indent on | ||
8 | |||
9 | syntax on | " enable syntax highlighting | ||
10 | syntax sync minlines=60 | " how many preceding lines will be parsed? (high performance impact) | ||
11 | |||
12 | set secure | " to ensure, that modelines do not contain executable code | ||
13 | set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins) | ||
14 | set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig) | ||
15 | set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against | ||
16 | set nonumber norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis | ||
17 | set 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) | ||
18 | set 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 | ||
25 | set expandtab | " replace tabs with spaces | ||
26 | set textwidth=0 | " should be set file type specific, colorcolumns is there to assist anyways | ||
27 | set tabstop=4 | ||
28 | set shiftwidth=4 | ||
29 | set softtabstop=4 | ||
30 | |||
31 | |||
32 | " ====================================================================================================================== | ||
33 | " SETTINGS: | ||
34 | " ====================================================================================================================== | ||
35 | set breakindent | " Every wrapped line will continue visually indented | ||
36 | set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) | ||
37 | set concealcursor=nc | " limits the display of concealed text to normal and command mode | ||
38 | set conceallevel=2 | " replace escaped chars by their UTF-8 representation (useful for LaTeX) | ||
39 | set confirm | " asks 'do you want to save?' | ||
40 | set cpoptions+=P | " makes :w filename set the current buffer to filename | ||
41 | set hidden | " allows switching buffers even if the current buffer contains changes (displays +) | ||
42 | set linebreak | " wrap long lines at char 'breakat', not inside words | ||
43 | set mousemodel=popup | " only in gvim: right click opens a pop-up-menu | ||
44 | set mouse=n | " allow mouse in normal mode only, so one can use the terminals c&p feature in insert mode | ||
45 | set noautochdir | " When on, Vim will change the current working directory | ||
46 | set nostartofline | " when scrolling: do not move the cursor to column 1 | ||
47 | set nowrap | " but do not (by default) wrap long lines around | ||
48 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | ||
49 | |||
50 | if has('nvim') " Neovim? | ||
51 | set inccommand=nosplit | " preview substitute and such things in real time | ||
52 | endif | ||
53 | |||
54 | if 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 | ||
65 | endif | ||
66 | |||
67 | set pumheight=8 | " Determines the maximum number of items to show in the pop-up menu for | ||
68 | set scrolljump=4 | " how many lines get scrolled into view when cursor reaches the screens edge | ||
69 | set scrolloff=4 | " keeps cursor centered | ||
70 | set shiftround | " indent/un-indent snaps to multiple of shiftwidths | ||
71 | set writedelay=0 | ||
72 | |||
73 | " display and performance | ||
74 | set lazyredraw | " disables redraw during macro execution (improves performance, but causes problems with solid backgrounds) | ||
75 | set cmdheight=2 | " sets the command line's height | ||
76 | set signcolumn=yes | " auto=auto hide, yes=always, no=never show the column with error indicators | ||
77 | set nocursorcolumn | " turn visual cursor column off (improves performance) | ||
78 | set updatetime=80 | " updates the screen more often | ||
79 | set redrawtime=1500 | " Timeout in milliseconds for redrawing the screen (switches syntax off when ssh too slow) / CTRL+L to retry | ||
80 | set notimeout | " improves performance but is known to cause problems on slow terminals | ||
81 | set ttimeout ttimeoutlen=150 | " set Esc key timeout in ms- | ||
82 | set showcmd | " essential: show keys of combined commands in the lower right corner (BUT SLOW, makes cursor flickering) | ||
83 | set showtabline=2 | " 0: never, 1: only if there are at least two tabs, 2:always | ||
84 | set shortmess+=I | " don't give the intro message when starting Vim |:intro|. | ||
85 | set wildmenu | " use a menu in the command line | ||
86 | set wildmode=longest:full | " do not preselect any entry and show all possible | ||
87 | |||
88 | " code completion | ||
89 | " set dictionary=/usr/share/dict/cracklib-small | ||
90 | set isfname-== | " remove = as char in filenames, because most FSs do not support it | ||
91 | set complete+=d | " scan current and included files for defined name or macro | ||
92 | set complete+=i | " scan current and included files for completions | ||
93 | set complete+=k | " make default completer <C-N> respect the dictionary | ||
94 | set complete-=u | " scan current and included files | ||
95 | set complete+=i | " scan current and included files | ||
96 | set 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 | ||
98 | set completeopt+=noinsert | " Do not insert any text for a match until the user selects one | ||
99 | set completeopt+=noselect | " Do not select a completion from the menu, let the user do that | ||
100 | set tagcase=match | " tagcase match, because we mostly use ^] to jump around and that variant respects the upper/lower case [followscs, followic, match, ignore] | ||
101 | set tags+=../tags | ||
102 | |||
103 | " code folding... | ||
104 | set nofoldenable | " disable folding, because we have zi to toggle foldenable :) | ||
105 | set foldclose=all | " automatically fold, when the cursor leaves the folded area | ||
106 | set 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 | ||
109 | set foldnestmax=1 | " top level folding only | ||
110 | set 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')) | ||
112 | set 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 | ||
116 | set foldexpr=!empty(filter(synstack(v:lnum,indent(v:lnum)+1),{_,val->match(synIDattr(val,'name'),'Comment')>-1})) | ||
117 | |||
118 | " vim window behaviour | ||
119 | set splitbelow | " open new windows below the current one (i find that more intuitive) | ||
120 | set splitright | " this also works for me and makes better use of the scren space I think | ||
121 | set winminwidth=0 | " (and all other windows, so TODO: watch out) | ||
122 | set winwidth=30 | " keep NERDTreeWindow at least this size | ||
123 | |||
124 | " vim session handling and restore behaviour | ||
125 | set viminfo+=% | " restore buffer list | ||
126 | set sessionoptions= | ||
127 | set sessionoptions+=buffers | ||
128 | set sessionoptions+=curdir | ||
129 | set sessionoptions+=folds | ||
130 | set sessionoptions+=resize | ||
131 | set sessionoptions+=slash | ||
132 | set sessionoptions+=tabpages | ||
133 | set sessionoptions+=unix | ||
134 | set sessionoptions+=winpos | ||
135 | set sessionoptions+=winsize | ||
136 | |||
137 | " set nocindent smartindent | " use smart indent rather then cindent | ||
138 | set noautoindent | ||
139 | set nosmartindent | ||
140 | |||
141 | set noshiftround | " indent/un-indent sna=ps to multiple of shiftwidths | ||
142 | set noequalalways | " do not evenly size windows when opening new or closing old | ||
143 | set nocursorline | " turn visual cursor line off (improves performance) | ||
144 | |||
145 | |||
146 | "======================================================================================================================= | ||
147 | " PATH -- where to search for includes (e.g. `gf` or `:find`) | ||
148 | "======================================================================================================================= | ||
149 | set path+=**4 | " allow recursive searches for files (limit depth by 4) | ||
150 | if executable("uname") " does not work under Windows | ||
151 | let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | ||
152 | endif | ||
153 | |||
154 | |||
155 | "======================================================================================================================= | ||
156 | " SPELL_CHECKING: | ||
157 | "======================================================================================================================= | ||
158 | let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell' | ||
159 | " add local user default spell file as primary source for words | ||
160 | let &spellfile=fnamemodify($MYVIMRC, ":p:h")."/spell/spellfile-user.UTF-8.add" | ||
161 | |||
162 | set nospell | " disable spell checker by default | ||
163 | set spelllang=en,de | " languages for the spell checker | ||
164 | set spellsuggest=10 | " how many words will z= suggest? | ||
165 | set thesaurus+=~/.vim/thesaurus/php.txt | ||
166 | |||
167 | |||
168 | "======================================================================================================================= | ||
169 | " UNDO: | ||
170 | " Persistent undo behaviour, also keeps undo history between starts | ||
171 | "======================================================================================================================= | ||
172 | if 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) | ||
181 | endif | ||
182 | |||
183 | |||
184 | "======================================================================================================================= | ||
185 | " DISPLAY & MULTI_BYTE | ||
186 | "======================================================================================================================= | ||
187 | if 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:\― | " | ||
222 | end | ||
223 | |||
224 | |||
225 | "======================================================================================================================= | ||
226 | " AUTOCMDs and FileType specific stuff | ||
227 | "======================================================================================================================= | ||
228 | if 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 | ||
278 | endif | ||
279 | |||
280 | " ====================================================================================================================== | ||
281 | augroup 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 | ||
295 | augroup END | ||
296 | |||
297 | "======================================================================================================================= | ||
298 | augroup 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 | ||
375 | augroup END | ||
376 | |||
377 | "======================================================================================================================= | ||
378 | " v modeline, do not chnage v | ||
379 | " vim: noai:ts=2:sw=2:sts=2 iskeyword+=\:,\<,\>,\-,\& number | ||