diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index d4ee163..562a1b3 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -56,8 +56,9 @@ map.i.nore[''] = 'guiw`]a' map.c.nore['w!!'] = [[execute 'silent! write !sudo tee % >/dev/null' edit!]] --- yank filename to f buffer -map.n.nore['yf'] = ':let @f = expand("%")' +-- yank current filename/filepath to f buffer +map.n.nore['yp'] = ':let @p = expand("%")' +map.n.nore['yP'] = ':let @p = expand("%:p")' -- repeat the last substitute command with all its flags preserved map.n.nore['&'] = ':&&' @@ -187,16 +188,11 @@ map.i.nore.silent['@@'] = 'u:CiteRef' -- Spell check set to O, 'o' for 'orthography': -- Move to the prev/next spelling error with [S ]S -- Move to the prev/next spelling error or suggestion with [s ]s -map.n.nore['Z'] = ':setlocal spell! spelllang=en_us,de_de' +map.n.nore['ZZ'] = ':setlocal spell! spelllang=en_us,de_de' map.n.nore['ZE'] = ':setlocal spell! spelllang=en_us' map.n.nore['ZG'] = ':setlocal spell! spelllang=en_us' map.n.nore['zz'] = '1z=' --- PLUGIN: tq thesaurus_query.vim --- nnoremap zt :ThesaurusQueryReplaceCurrentWord -map.n.nore['zt'] = ':ThesaurusQueryReplaceCurrentWord' -map.v.nore['zt'] = '"ky:ThesaurusQueryReplace k' - -- pp to comPile a document (or file, works for some languages like go/python/c) -- o to open the resulting document (mostly for pdfs) -- po to comPile *and* open a doc @@ -265,3 +261,7 @@ map.n.nore['[c'] = ':IPythonCellPrevCell' -- insert cell header above/below map.n.nore['cO'] = ':IPythonCellInsertAbovea' map.n.nore['co'] = ':IPythonCellInsertBelowa' + +-- PLUGIN: betterdigraphs +-- allow normal digraph insertion on c-k, search on c-k c-k +map.i.nore[''] = 'lua require "betterdigraphs".digraphs("i")' diff --git a/nvim/.config/nvim/lua/plug/_lsp.lua b/nvim/.config/nvim/lua/plug/_lsp.lua index c54a510..ce2acaa 100644 --- a/nvim/.config/nvim/lua/plug/_lsp.lua +++ b/nvim/.config/nvim/lua/plug/_lsp.lua @@ -72,6 +72,8 @@ cmp.setup({ {name = 'pandoc_references'}, {name = 'vCard'} }, {{name = 'buffer'}, {name = 'spell'}}) }) +if vim.o.ft == 'clap_input' and vim.o.ft == 'guihua' and vim.o.ft == + 'guihua_rust' then require'cmp'.setup.buffer {completion = {enable = false}} end -- Use buffer source for `/` search cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}}) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index d77650e..a13364c 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -122,9 +122,9 @@ require("packer").startup(function() -- REPL work use { 'jpalardy/vim-slime', -- send arbitrary code chunks to REPLs - ft = "python", config = function() vim.g.slime_target = 'tmux' + vim.g.slime_paste_file = vim.fn.tempname() vim.g.slime_default_config = { socket_name = "default", target_pane = "{last}" @@ -165,6 +165,10 @@ require("packer").startup(function() }, config = function() require('plug._telescope') end } + use { + 'protex/better-digraphs.nvim', + requires = {{"nvim-telescope/telescope.nvim"}} + } -- snippeting use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine diff --git a/nvim/.config/nvim/lua/settings.lua b/nvim/.config/nvim/lua/settings.lua index 253f4c0..31b7ca5 100644 --- a/nvim/.config/nvim/lua/settings.lua +++ b/nvim/.config/nvim/lua/settings.lua @@ -1,19 +1,12 @@ require("helpers.vimoptions") -local default_builtins_disabled = { - "netrw", - "netrwPlugin" -} +local default_builtins_disabled = {"netrw", "netrwPlugin"} local disable_builtins = function(builtins) - for _, plugin in pairs(builtins) do - vim.g["loaded_" .. plugin] = 1 - end + for _, plugin in pairs(builtins) do vim.g["loaded_" .. plugin] = 1 end end local apply_options = function(opts) - for k, v in pairs(opts) do - vim.opt[k] = v - end + for k, v in pairs(opts) do vim.opt[k] = v end end local o = { @@ -37,43 +30,45 @@ local o = { -- shows linenumbers relative to the one you are on, for easy movement and -- dNUMBERd deletions - number = true, - relativenumber = true, + number = true, + relativenumber = true, + -- puts the numbers into the signcolumn so when git/lsp show signs there's no jump + signcolumn = 'number', -- keeps an undofile next to files so that you can even undo if vim is closed -- in between - undofile = true, + undofile = true, -- TODO o.undodir = '~/.cache/nvim/undodir' -- ignores case by default but will use case when search is specifically not -- all lowercased - ignorecase = true, - smartcase = true, + ignorecase = true, + smartcase = true, -- shows previews of what substitute command will do (and a couple others) - inccommand = 'split', + inccommand = 'split', -- disables showing us the current mode in the command line since airline takes -- care of it - showmode = false, + showmode = false, -- turn off modeline, to ensure security observation - modeline = false, + modeline = false, -- i feel foldlevel 2 is generally pretty usable, for headlines and similar - foldlevel = 2, - conceallevel = 2, + foldlevel = 2, + conceallevel = 2, -- enable mouse, doesn't bug me and might come in useful at some point - mouse = 'a', + mouse = 'a', -- pump all clippings into the system clipboard - clipboard='unnamedplus', + clipboard = 'unnamedplus', -- turn of automatic resizing of individual splits equalalways = false, -- make sure there's always *some* context below cursor - scrolloff=4, + scrolloff = 4 } diff --git a/qutebrowser/.config/qutebrowser/maps.py b/qutebrowser/.config/qutebrowser/maps.py index 9aabbb1..e3daae5 100644 --- a/qutebrowser/.config/qutebrowser/maps.py +++ b/qutebrowser/.config/qutebrowser/maps.py @@ -17,28 +17,28 @@ config.bind("", "command-history-next", mode="command") config.bind("", "command-history-prev", mode="command") config.bind("", "completion-item-focus prev", mode="command") config.bind("", "completion-item-focus next", mode="command") -config.bind('', 'rl-backward-kill-word', mode='command') -config.bind('', 'rl-kill-word', mode='command') -config.bind('', 'rl-forward-word', mode='command') -config.bind('', 'rl-delete-char', mode='command') -config.bind('', 'rl-beginning-of-line', mode='command') -config.bind('', 'rl-backward-char', mode='command') -config.bind('', 'completion-item-yank', mode='command') -config.bind('', 'completion-item-del', mode='command') -config.bind('', 'rl-end-of-line', mode='command') -config.bind('', 'rl-forward-char', mode='command') -config.bind('', 'rl-backward-delete-char', mode='command') -config.bind('', 'completion-item-focus prev-category', mode='command') -config.bind('', 'completion-item-focus next-category', mode='command') -config.bind('', 'rl-unix-line-discard', mode='command') -config.bind('', 'rl-unix-word-rubout', mode='command') -config.bind('', 'rl-yank', mode='command') +config.bind("", "rl-backward-kill-word", mode="command") +config.bind("", "rl-kill-word", mode="command") +config.bind("", "rl-forward-word", mode="command") +config.bind("", "rl-delete-char", mode="command") +config.bind("", "rl-beginning-of-line", mode="command") +config.bind("", "rl-backward-char", mode="command") +config.bind("", "completion-item-yank", mode="command") +config.bind("", "completion-item-del", mode="command") +config.bind("", "rl-end-of-line", mode="command") +config.bind("", "rl-forward-char", mode="command") +config.bind("", "rl-backward-delete-char", mode="command") +config.bind("", "completion-item-focus prev-category", mode="command") +config.bind("", "completion-item-focus next-category", mode="command") +config.bind("", "rl-unix-line-discard", mode="command") +config.bind("", "rl-unix-word-rubout", mode="command") +config.bind("", "rl-yank", mode="command") ## ADDED # toggles ('cycles') between tabs always showing, or only when switching between them config.bind( leader + "tt", - "config-cycle -t tabs.show always switching ;; config-cycle -t statusbar.show in-mode always", + "config-cycle -t tabs.show always switching ;; config-cycle -t statusbar.show always in-mode", ) config.bind(leader + "th", "set tabs.position bottom") config.bind(leader + "tH", "set tabs.position top") @@ -63,7 +63,8 @@ config.bind(lleader + "dp", "save_to_pdf", mode="normal") # open last download config.bind("gD", "spawn --userscript open_download") -config.bind('"w', "add-wallabag", mode="normal") +config.bind('"w', "add-wallabag", mode="normal") # add current page to wallabag +config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallabag config.bind('"s', "add-shaarli", mode="normal") config.bind('"a', "send-to-archive", mode="normal") diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh b/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh index 7b04ff3..18c373f 100755 --- a/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh +++ b/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh @@ -1,7 +1,20 @@ #! /usr/bin/bash +# +# Send current page/link to a wallabag instance. +# +# Can be used for sending the current page via: +# :spawn --userscript wallabag_add.sh +# for sending an arbitrary page passed as argument: +# :spawn --userscript wallabag_add.sh https://myinterestingtext.com +# or for sending a hinted link: +# :hint links userscript wallabag_add.sh +# +# Configure your wallabag instance with this: +WALLABAG_INSTANCE="https://read.martyoeh.me" -# from swalladge: -# https://github.com/swalladge/dotfiles/blob/master/local/share/qutebrowser/userscripts/wallabag_add.sh - -# v2.* -echo "open https://read.martyoeh.me/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO" +# only works for wallabag v2.* +if [ "$#" -gt 0 ]; then + echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$*" >>"$QUTE_FIFO" +else + echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO" +fi diff --git a/ssh/.ssh/conf/config.ssh b/ssh/.ssh/conf/config.ssh deleted file mode 100644 index 1768d6c..0000000 --- a/ssh/.ssh/conf/config.ssh +++ /dev/null @@ -1,5 +0,0 @@ -# Send a keepalive package every 15 seconds without data -ServerAliveInterval 15 - -# conserve some bandwidth at the cost of processing power -Compression yes diff --git a/ssh/.ssh/config b/ssh/.ssh/config index 2d4b429..628ec7c 100644 --- a/ssh/.ssh/config +++ b/ssh/.ssh/config @@ -1,2 +1,7 @@ -Include ~/.ssh/conf/config.ssh -Include ~/.ssh/conf/hosts.ssh +# Send a keepalive package every 15 seconds without data +ServerAliveInterval 15 + +# conserve some bandwidth at the cost of processing power +Compression yes + +Include ~/.ssh/hosts diff --git a/ssh/.ssh/scripts/check-fingerprint b/ssh/.ssh/scripts/check-fingerprint new file mode 100755 index 0000000..fcbdf4a --- /dev/null +++ b/ssh/.ssh/scripts/check-fingerprint @@ -0,0 +1,21 @@ +#!/bin/bash +# from: https://awbmilne.github.io/blog/SSH-Host-Fallback/ +# Takes 2 arguments: a hostname and an ssh fingerprint +# Retrieves all fingerprints from hostname and compares +# to see if the fingerprint passed in is part of them. +# If it is, returns true; if not, false. +# Can be used for more secure matching on hostname availability +# in sshconfig than e.g. nc ip matching. +# +# To find your keys fingerprint, one option is just connecting +# via `ssh -v` and looking for the fingerprint there. + +fingerprints=$(ssh-keygen -lf <(ssh-keyscan "$1" 2>/dev/null)) + +for fingerprint in $fingerprints; do + if [ "$fingerprint" == "$2" ]; then + exit 0 + fi +done + +exit 1