Compare commits
7 commits
26f4cc6062
...
363f4ac5e6
Author | SHA1 | Date | |
---|---|---|---|
363f4ac5e6 | |||
11c1383f01 | |||
eb1dabc44f | |||
645248e83a | |||
a49e49bbd4 | |||
9a1efff30c | |||
bef798418e |
9 changed files with 98 additions and 62 deletions
|
@ -56,8 +56,9 @@ map.i.nore['<C-l>'] = '<esc>guiw`]a'
|
||||||
map.c.nore['w!!'] =
|
map.c.nore['w!!'] =
|
||||||
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
|
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
|
||||||
|
|
||||||
-- yank filename to f buffer
|
-- yank current filename/filepath to f buffer
|
||||||
map.n.nore['yf'] = ':let @f = expand("%")<cr>'
|
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
|
-- repeat the last substitute command with all its flags preserved
|
||||||
map.n.nore['&'] = ':&&<cr>'
|
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':
|
-- 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 with [S ]S
|
||||||
-- Move to the prev/next spelling error or suggestion 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>ZE'] = ':setlocal spell! spelllang=en_us<cr>'
|
||||||
map.n.nore['<leader>ZG'] = ':setlocal spell! spelllang=en_us<cr>'
|
map.n.nore['<leader>ZG'] = ':setlocal spell! spelllang=en_us<cr>'
|
||||||
map.n.nore['<leader>zz'] = '1z='
|
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)
|
-- pp to comPile a document (or file, works for some languages like go/python/c)
|
||||||
-- o to open the resulting document (mostly for pdfs)
|
-- o to open the resulting document (mostly for pdfs)
|
||||||
-- po to comPile *and* open a doc
|
-- po to comPile *and* open a doc
|
||||||
|
@ -265,3 +261,7 @@ map.n.nore['[c'] = ':IPythonCellPrevCell<cr>'
|
||||||
-- insert cell header above/below
|
-- insert cell header above/below
|
||||||
map.n.nore['<leader>cO'] = ':IPythonCellInsertAbove<cr>a'
|
map.n.nore['<leader>cO'] = ':IPythonCellInsertAbove<cr>a'
|
||||||
map.n.nore['<leader>co'] = ':IPythonCellInsertBelow<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>'
|
||||||
|
|
|
@ -72,6 +72,8 @@ cmp.setup({
|
||||||
{name = 'pandoc_references'}, {name = 'vCard'}
|
{name = 'pandoc_references'}, {name = 'vCard'}
|
||||||
}, {{name = 'buffer'}, {name = 'spell'}})
|
}, {{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
|
-- Use buffer source for `/` search
|
||||||
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
|
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
|
||||||
|
|
|
@ -122,9 +122,9 @@ require("packer").startup(function()
|
||||||
-- REPL work
|
-- REPL work
|
||||||
use {
|
use {
|
||||||
'jpalardy/vim-slime', -- send arbitrary code chunks to REPLs
|
'jpalardy/vim-slime', -- send arbitrary code chunks to REPLs
|
||||||
ft = "python",
|
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.slime_target = 'tmux'
|
vim.g.slime_target = 'tmux'
|
||||||
|
vim.g.slime_paste_file = vim.fn.tempname()
|
||||||
vim.g.slime_default_config = {
|
vim.g.slime_default_config = {
|
||||||
socket_name = "default",
|
socket_name = "default",
|
||||||
target_pane = "{last}"
|
target_pane = "{last}"
|
||||||
|
@ -165,6 +165,10 @@ require("packer").startup(function()
|
||||||
},
|
},
|
||||||
config = function() require('plug._telescope') end
|
config = function() require('plug._telescope') end
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'protex/better-digraphs.nvim',
|
||||||
|
requires = {{"nvim-telescope/telescope.nvim"}}
|
||||||
|
}
|
||||||
|
|
||||||
-- snippeting
|
-- snippeting
|
||||||
use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine
|
use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
require("helpers.vimoptions")
|
require("helpers.vimoptions")
|
||||||
|
|
||||||
local default_builtins_disabled = {
|
local default_builtins_disabled = {"netrw", "netrwPlugin"}
|
||||||
"netrw",
|
|
||||||
"netrwPlugin"
|
|
||||||
}
|
|
||||||
local disable_builtins = function(builtins)
|
local disable_builtins = function(builtins)
|
||||||
for _, plugin in pairs(builtins) do
|
for _, plugin in pairs(builtins) do vim.g["loaded_" .. plugin] = 1 end
|
||||||
vim.g["loaded_" .. plugin] = 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local apply_options = function(opts)
|
local apply_options = function(opts)
|
||||||
for k, v in pairs(opts) do
|
for k, v in pairs(opts) do vim.opt[k] = v end
|
||||||
vim.opt[k] = v
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local o = {
|
local o = {
|
||||||
|
@ -39,6 +32,8 @@ local o = {
|
||||||
-- dNUMBERd deletions
|
-- dNUMBERd deletions
|
||||||
number = true,
|
number = true,
|
||||||
relativenumber = 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
|
-- keeps an undofile next to files so that you can even undo if vim is closed
|
||||||
-- in between
|
-- in between
|
||||||
|
@ -73,7 +68,7 @@ local o = {
|
||||||
equalalways = false,
|
equalalways = false,
|
||||||
|
|
||||||
-- make sure there's always *some* context below cursor
|
-- make sure there's always *some* context below cursor
|
||||||
scrolloff=4,
|
scrolloff = 4
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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-K>", "command-history-prev", mode="command")
|
||||||
config.bind("<Ctrl-P>", "completion-item-focus 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("<Ctrl-N>", "completion-item-focus next", mode="command")
|
||||||
config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command')
|
config.bind("<Alt-Backspace>", "rl-backward-kill-word", mode="command")
|
||||||
config.bind('<Alt-D>', 'rl-kill-word', mode='command')
|
config.bind("<Alt-D>", "rl-kill-word", mode="command")
|
||||||
config.bind('<Alt-F>', 'rl-forward-word', mode='command')
|
config.bind("<Alt-F>", "rl-forward-word", mode="command")
|
||||||
config.bind('<Ctrl-?>', 'rl-delete-char', mode='command')
|
config.bind("<Ctrl-?>", "rl-delete-char", mode="command")
|
||||||
config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command')
|
config.bind("<Ctrl-A>", "rl-beginning-of-line", mode="command")
|
||||||
config.bind('<Ctrl-B>', 'rl-backward-char', mode='command')
|
config.bind("<Ctrl-B>", "rl-backward-char", mode="command")
|
||||||
config.bind('<Ctrl-C>', 'completion-item-yank', mode='command')
|
config.bind("<Ctrl-C>", "completion-item-yank", mode="command")
|
||||||
config.bind('<Ctrl-D>', 'completion-item-del', mode='command')
|
config.bind("<Ctrl-D>", "completion-item-del", mode="command")
|
||||||
config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command')
|
config.bind("<Ctrl-E>", "rl-end-of-line", mode="command")
|
||||||
config.bind('<Ctrl-F>', 'rl-forward-char', mode='command')
|
config.bind("<Ctrl-F>", "rl-forward-char", mode="command")
|
||||||
config.bind('<Ctrl-H>', 'rl-backward-delete-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-Shift-Tab>", "completion-item-focus prev-category", mode="command")
|
||||||
config.bind('<Ctrl-Tab>', 'completion-item-focus next-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-U>", "rl-unix-line-discard", mode="command")
|
||||||
config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command')
|
config.bind("<Ctrl-W>", "rl-unix-word-rubout", mode="command")
|
||||||
config.bind('<Ctrl-Y>', 'rl-yank', mode='command')
|
config.bind("<Ctrl-Y>", "rl-yank", mode="command")
|
||||||
|
|
||||||
## ADDED
|
## ADDED
|
||||||
# toggles ('cycles') between tabs always showing, or only when switching between them
|
# toggles ('cycles') between tabs always showing, or only when switching between them
|
||||||
config.bind(
|
config.bind(
|
||||||
leader + "tt",
|
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 bottom")
|
||||||
config.bind(leader + "tH", "set tabs.position top")
|
config.bind(leader + "tH", "set tabs.position top")
|
||||||
|
@ -63,7 +63,8 @@ config.bind(lleader + "dp", "save_to_pdf", mode="normal")
|
||||||
# open last download
|
# open last download
|
||||||
config.bind("gD", "spawn --userscript open_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('"s', "add-shaarli", mode="normal")
|
||||||
|
|
||||||
config.bind('"a', "send-to-archive", mode="normal")
|
config.bind('"a', "send-to-archive", mode="normal")
|
||||||
|
|
|
@ -1,7 +1,20 @@
|
||||||
#! /usr/bin/bash
|
#! /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:
|
# only works for wallabag v2.*
|
||||||
# https://github.com/swalladge/dotfiles/blob/master/local/share/qutebrowser/userscripts/wallabag_add.sh
|
if [ "$#" -gt 0 ]; then
|
||||||
|
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$*" >>"$QUTE_FIFO"
|
||||||
# v2.*
|
else
|
||||||
echo "open https://read.martyoeh.me/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
|
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
|
||||||
|
fi
|
||||||
|
|
|
@ -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
|
|
|
@ -1,2 +1,7 @@
|
||||||
Include ~/.ssh/conf/config.ssh
|
# Send a keepalive package every 15 seconds without data
|
||||||
Include ~/.ssh/conf/hosts.ssh
|
ServerAliveInterval 15
|
||||||
|
|
||||||
|
# conserve some bandwidth at the cost of processing power
|
||||||
|
Compression yes
|
||||||
|
|
||||||
|
Include ~/.ssh/hosts
|
||||||
|
|
21
ssh/.ssh/scripts/check-fingerprint
Executable file
21
ssh/.ssh/scripts/check-fingerprint
Executable 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
|
Loading…
Reference in a new issue