Compare commits

...

7 commits

Author SHA1 Message Date
363f4ac5e6
nvim: Add telescope digraph search
Added plugin for digraph search through telescope.
When you want to enter a digraph, you can do so through the usual
method, pressing <c-k> and then entering the digraph shortcut (e.g.
`<c-k>OK` for ✓, or `<c-k>n?` for ñ) OR you simply double press
<c-k><c-k> which opens a quick telescope window to select the digraph
you want.
2022-03-08 10:01:40 +01:00
11c1383f01
nvim: Remove thesaurus mappings, Update spell map
Updated enabling spellchecker from <leader>Z to <leader>ZZ.
<leader>ZE and <leader>ZG for language specific checking stays the same
as before.

Removed some dangling mappings referring to thesaurus_query plugin which
has long been removed.
2022-03-08 09:59:49 +01:00
eb1dabc44f
nvim: Fix signcolumn jumping
When lsp or gitsigns would show me a symbol in the signcolumn the whole
editor page would jump ever so slightly to the right (one symbol, to be
precise).

This fixes it to show numbers in the signcolumn and just exchange number
for sign when something should be shown.
Makes numbers a little less readable but editing experience a whole lot
smoother.
2022-03-08 09:33:58 +01:00
645248e83a
ssh: Add host fingerprint matching
Added fingerprint matching to host functionality replacing the old
matching on ip with nc idea.
Functions essentially the same, only that now if another host
randomly/or targeted replaces the original checking target you will
still not try to be connected since the ssh fingerprint will not match.
Should make it a teensy bit more secure.
2022-03-08 09:26:24 +01:00
a49e49bbd4
nvim: Change path copy mapping
Changed mapping to copy path from `yf` to `yp`/`yP`.
Two reasons: I might be better able to remember 'yank-path' when saying
it in my head as a mnemonic, and with the `yf` mapping set I could only
yank things *to* some letter `yt<letter>` not including some letter
`yf<letter>` and it has been very subtly annoying me ever since I
introduced the mapping.
Fixed now.

Also added two variations: `yp` will yank the whole path into the `p`
register, and `yP` will only yank the filename itself.
Here's to remembering the new mapping!
2022-03-07 22:05:45 +01:00
9a1efff30c
nvim: Fix vim-slime temp file, cmp float window
Fixed hidden file creation in home directory by vim-slime. It will now
rather ask nvim to create a temporary file using that as its paste
source.

Also disabled cmp completion in 'guihua' floating windows, as per the
recommendation for navigator.lua.
2022-03-07 21:58:37 +01:00
bef798418e
qutebrowser: Update wallabag userscript
Updated wallabag userscript to be able to both use the current page when
called from qutebrowser or any arbitrary url passed as an argument.
2022-03-05 22:50:16 +01:00
9 changed files with 98 additions and 62 deletions

View file

@ -56,8 +56,9 @@ map.i.nore['<C-l>'] = '<esc>guiw`]a'
map.c.nore['w!!'] =
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
-- yank filename to f buffer
map.n.nore['yf'] = ':let @f = expand("%")<cr>'
-- yank current filename/filepath to f buffer
map.n.nore['yp'] = ':let @p = expand("%")<Cr>'
map.n.nore['yP'] = ':let @p = expand("%:p")<Cr>'
-- repeat the last substitute command with all its flags preserved
map.n.nore['&'] = ':&&<cr>'
@ -187,16 +188,11 @@ map.i.nore.silent['@@'] = '<c-g>u<c-o>:CiteRef<cr>'
-- Spell check set to <leader>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['<leader>Z'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
map.n.nore['<leader>ZZ'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
map.n.nore['<leader>ZE'] = ':setlocal spell! spelllang=en_us<cr>'
map.n.nore['<leader>ZG'] = ':setlocal spell! spelllang=en_us<cr>'
map.n.nore['<leader>zz'] = '1z='
-- PLUGIN: tq thesaurus_query.vim
-- nnoremap <leader>zt :ThesaurusQueryReplaceCurrentWord<cr>
map.n.nore['<leader>zt'] = ':ThesaurusQueryReplaceCurrentWord<cr>'
map.v.nore['<leader>zt'] = '"ky:ThesaurusQueryReplace <cr>k<cr>'
-- 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<cr>'
-- insert cell header above/below
map.n.nore['<leader>cO'] = ':IPythonCellInsertAbove<cr>a'
map.n.nore['<leader>co'] = ':IPythonCellInsertBelow<cr>a'
-- PLUGIN: betterdigraphs
-- allow normal digraph insertion on c-k, search on c-k c-k
map.i.nore['<C-k><C-k>'] = '<Cmd>lua require "betterdigraphs".digraphs("i")<CR>'

View file

@ -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'}}})

View file

@ -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

View file

@ -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 = {
@ -39,6 +32,8 @@ local o = {
-- dNUMBERd deletions
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
@ -67,13 +62,13 @@ local o = {
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
}

View file

@ -17,28 +17,28 @@ config.bind("<Ctrl-J>", "command-history-next", mode="command")
config.bind("<Ctrl-K>", "command-history-prev", mode="command")
config.bind("<Ctrl-P>", "completion-item-focus prev", mode="command")
config.bind("<Ctrl-N>", "completion-item-focus next", mode="command")
config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command')
config.bind('<Alt-D>', 'rl-kill-word', mode='command')
config.bind('<Alt-F>', 'rl-forward-word', mode='command')
config.bind('<Ctrl-?>', 'rl-delete-char', mode='command')
config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command')
config.bind('<Ctrl-B>', 'rl-backward-char', mode='command')
config.bind('<Ctrl-C>', 'completion-item-yank', mode='command')
config.bind('<Ctrl-D>', 'completion-item-del', mode='command')
config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command')
config.bind('<Ctrl-F>', 'rl-forward-char', mode='command')
config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='command')
config.bind('<Ctrl-Shift-Tab>', 'completion-item-focus prev-category', mode='command')
config.bind('<Ctrl-Tab>', 'completion-item-focus next-category', mode='command')
config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='command')
config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command')
config.bind('<Ctrl-Y>', 'rl-yank', mode='command')
config.bind("<Alt-Backspace>", "rl-backward-kill-word", mode="command")
config.bind("<Alt-D>", "rl-kill-word", mode="command")
config.bind("<Alt-F>", "rl-forward-word", mode="command")
config.bind("<Ctrl-?>", "rl-delete-char", mode="command")
config.bind("<Ctrl-A>", "rl-beginning-of-line", mode="command")
config.bind("<Ctrl-B>", "rl-backward-char", mode="command")
config.bind("<Ctrl-C>", "completion-item-yank", mode="command")
config.bind("<Ctrl-D>", "completion-item-del", mode="command")
config.bind("<Ctrl-E>", "rl-end-of-line", mode="command")
config.bind("<Ctrl-F>", "rl-forward-char", mode="command")
config.bind("<Ctrl-H>", "rl-backward-delete-char", mode="command")
config.bind("<Ctrl-Shift-Tab>", "completion-item-focus prev-category", mode="command")
config.bind("<Ctrl-Tab>", "completion-item-focus next-category", mode="command")
config.bind("<Ctrl-U>", "rl-unix-line-discard", mode="command")
config.bind("<Ctrl-W>", "rl-unix-word-rubout", mode="command")
config.bind("<Ctrl-Y>", "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")

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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