Compare commits
No commits in common. "363f4ac5e61784671bb1464d7293647c6fffe167" and "26f4cc6062475ee54cbd7b2e79755f8129ac90db" have entirely different histories.
363f4ac5e6
...
26f4cc6062
9 changed files with 62 additions and 98 deletions
|
@ -56,9 +56,8 @@ 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 current filename/filepath to f buffer
|
-- yank filename to f buffer
|
||||||
map.n.nore['yp'] = ':let @p = expand("%")<Cr>'
|
map.n.nore['yf'] = ':let @f = 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>'
|
||||||
|
@ -188,11 +187,16 @@ 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>ZZ'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
|
map.n.nore['<leader>Z'] = ':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
|
||||||
|
@ -261,7 +265,3 @@ 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,8 +72,6 @@ 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,10 +165,6 @@ 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,12 +1,19 @@
|
||||||
require("helpers.vimoptions")
|
require("helpers.vimoptions")
|
||||||
|
|
||||||
local default_builtins_disabled = {"netrw", "netrwPlugin"}
|
local default_builtins_disabled = {
|
||||||
|
"netrw",
|
||||||
|
"netrwPlugin"
|
||||||
|
}
|
||||||
local disable_builtins = function(builtins)
|
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
|
end
|
||||||
|
|
||||||
local apply_options = function(opts)
|
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
|
end
|
||||||
|
|
||||||
local o = {
|
local o = {
|
||||||
|
@ -30,45 +37,43 @@ local o = {
|
||||||
|
|
||||||
-- shows linenumbers relative to the one you are on, for easy movement and
|
-- shows linenumbers relative to the one you are on, for easy movement and
|
||||||
-- 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
|
||||||
undofile = true,
|
undofile = true,
|
||||||
-- TODO o.undodir = '~/.cache/nvim/undodir'
|
-- TODO o.undodir = '~/.cache/nvim/undodir'
|
||||||
|
|
||||||
-- ignores case by default but will use case when search is specifically not
|
-- ignores case by default but will use case when search is specifically not
|
||||||
-- all lowercased
|
-- all lowercased
|
||||||
ignorecase = true,
|
ignorecase = true,
|
||||||
smartcase = true,
|
smartcase = true,
|
||||||
|
|
||||||
-- shows previews of what substitute command will do (and a couple others)
|
-- 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
|
-- disables showing us the current mode in the command line since airline takes
|
||||||
-- care of it
|
-- care of it
|
||||||
showmode = false,
|
showmode = false,
|
||||||
-- turn off modeline, to ensure security observation
|
-- turn off modeline, to ensure security observation
|
||||||
modeline = false,
|
modeline = false,
|
||||||
|
|
||||||
-- i feel foldlevel 2 is generally pretty usable, for headlines and similar
|
-- i feel foldlevel 2 is generally pretty usable, for headlines and similar
|
||||||
foldlevel = 2,
|
foldlevel = 2,
|
||||||
conceallevel = 2,
|
conceallevel = 2,
|
||||||
|
|
||||||
-- enable mouse, doesn't bug me and might come in useful at some point
|
-- 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
|
-- pump all clippings into the system clipboard
|
||||||
clipboard = 'unnamedplus',
|
clipboard='unnamedplus',
|
||||||
|
|
||||||
-- turn of automatic resizing of individual splits
|
-- turn of automatic resizing of individual splits
|
||||||
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 always in-mode",
|
"config-cycle -t tabs.show always switching ;; config-cycle -t statusbar.show in-mode always",
|
||||||
)
|
)
|
||||||
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,8 +63,7 @@ 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") # add current page to wallabag
|
config.bind('"w', "add-wallabag", mode="normal")
|
||||||
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,20 +1,7 @@
|
||||||
#! /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"
|
|
||||||
|
|
||||||
# only works for wallabag v2.*
|
# from swalladge:
|
||||||
if [ "$#" -gt 0 ]; then
|
# https://github.com/swalladge/dotfiles/blob/master/local/share/qutebrowser/userscripts/wallabag_add.sh
|
||||||
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$*" >>"$QUTE_FIFO"
|
|
||||||
else
|
# v2.*
|
||||||
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
|
echo "open https://read.martyoeh.me/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
|
||||||
fi
|
|
||||||
|
|
5
ssh/.ssh/conf/config.ssh
Normal file
5
ssh/.ssh/conf/config.ssh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Send a keepalive package every 15 seconds without data
|
||||||
|
ServerAliveInterval 15
|
||||||
|
|
||||||
|
# conserve some bandwidth at the cost of processing power
|
||||||
|
Compression yes
|
|
@ -1,7 +1,2 @@
|
||||||
# Send a keepalive package every 15 seconds without data
|
Include ~/.ssh/conf/config.ssh
|
||||||
ServerAliveInterval 15
|
Include ~/.ssh/conf/hosts.ssh
|
||||||
|
|
||||||
# conserve some bandwidth at the cost of processing power
|
|
||||||
Compression yes
|
|
||||||
|
|
||||||
Include ~/.ssh/hosts
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/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