misc: some settings
This commit is contained in:
parent
eab3612862
commit
5a347f6f5b
11
bin/nnnedit
Executable file
11
bin/nnnedit
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
MIMETYPE=$(xdg-mime query filetype "$1")
|
||||||
|
case "$MIMETYPE" in
|
||||||
|
image/*)
|
||||||
|
gimp "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
"$EDITOR" "$1"
|
||||||
|
;;
|
||||||
|
esac
|
2
bin/sc
2
bin/sc
|
@ -4,7 +4,7 @@ set -e
|
||||||
VIRTMON=virtmon
|
VIRTMON=virtmon
|
||||||
SC_FONT=${SC_FONT:-'WenQuanYi-Micro-Hei'}
|
SC_FONT=${SC_FONT:-'WenQuanYi-Micro-Hei'}
|
||||||
PID_FILE="/tmp/recording.pid"
|
PID_FILE="/tmp/recording.pid"
|
||||||
OUTPUT_DIR="/home/klesh/Videos"
|
OUTPUT_DIR="$HOME/Videos"
|
||||||
|
|
||||||
_stop_recording() {
|
_stop_recording() {
|
||||||
killall screenkey 2>/dev/null || true
|
killall screenkey 2>/dev/null || true
|
||||||
|
|
|
@ -25,6 +25,7 @@ if status is-interactive
|
||||||
set -gx LS_COLORS 'ow=34;42;40'
|
set -gx LS_COLORS 'ow=34;42;40'
|
||||||
|
|
||||||
# === nnn configuration
|
# === nnn configuration
|
||||||
|
set -gx VISUAL nnnedit
|
||||||
set -gx NNN_PLUG 'c:fzcd;m:nmount;x:!chmod +x $nnn;X:!chmod -x $nnn;d:dragdrop;p:preview-tui'
|
set -gx NNN_PLUG 'c:fzcd;m:nmount;x:!chmod +x $nnn;X:!chmod -x $nnn;d:dragdrop;p:preview-tui'
|
||||||
set -gx NNN_FIFO /tmp/nnn.fifo
|
set -gx NNN_FIFO /tmp/nnn.fifo
|
||||||
set -gx NNN_ARCHIVE '\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
|
set -gx NNN_ARCHIVE '\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
|
||||||
|
|
|
@ -32,6 +32,7 @@ case "$PM" in
|
||||||
sudo pacman -S --noconfirm --needed nnn ueberzug
|
sudo pacman -S --noconfirm --needed nnn ueberzug
|
||||||
mkdir -p "$NNN_CONFIG_DIR/plugins"
|
mkdir -p "$NNN_CONFIG_DIR/plugins"
|
||||||
cp -r /usr/share/nnn/plugins/* "$NNN_CONFIG_DIR/plugins"
|
cp -r /usr/share/nnn/plugins/* "$NNN_CONFIG_DIR/plugins"
|
||||||
|
yay -S dragon-drop
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
-- global options
|
-- global options
|
||||||
vim.g.mapleader = ";"
|
vim.g.mapleader = ";"
|
||||||
vim.g.clipboard = {
|
vim.g.clipboard = {
|
||||||
name = "sysclip",
|
name = "sysclip",
|
||||||
copy = {
|
copy = {
|
||||||
["+"] = {"xsel", "-b"},
|
["+"] = { "xsel", "-b" },
|
||||||
["*"] = {"xsel", "-b"},
|
["*"] = { "xsel", "-b" },
|
||||||
},
|
},
|
||||||
paste = {
|
paste = {
|
||||||
["+"] = {"xsel", "-b"},
|
["+"] = { "xsel", "-b" },
|
||||||
["*"] = {"xsel", "-b"},
|
["*"] = { "xsel", "-b" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- general options
|
-- general options
|
||||||
|
@ -38,8 +38,8 @@ require("plugins")
|
||||||
|
|
||||||
local gruvbox_ok, _ = pcall(require, "gruvbox")
|
local gruvbox_ok, _ = pcall(require, "gruvbox")
|
||||||
if gruvbox_ok then
|
if gruvbox_ok then
|
||||||
vim.o.background = "dark"
|
vim.o.background = "dark"
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
colorscheme gruvbox
|
colorscheme gruvbox
|
||||||
highlight Normal ctermbg=None guibg=none
|
highlight Normal ctermbg=None guibg=none
|
||||||
highlight CursorLine ctermbg=240
|
highlight CursorLine ctermbg=240
|
||||||
|
@ -47,4 +47,15 @@ if gruvbox_ok then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- format on save
|
||||||
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()]]
|
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()]]
|
||||||
|
|
||||||
|
|
||||||
|
-- open quickfix buffer after :grep or :vimgrep
|
||||||
|
vim.cmd [[
|
||||||
|
augroup quickfix
|
||||||
|
autocmd!
|
||||||
|
autocmd QuickFixCmdPost [^l]* cwindow
|
||||||
|
autocmd QuickFixCmdPost l* lwindow
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
|
|
@ -51,6 +51,7 @@ keymap(NORMAL, '<leader>tm', ':Telescope media_files<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gc', ':Telescope git_branches<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gc', ':Telescope git_branches<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gr', ':Telescope lsp_references<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gr', ':Telescope lsp_references<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gds', ':Telescope lsp_document_symbols<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gds', ':Telescope lsp_document_symbols<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>ca', ':lua vim.lsp.buf.code_action', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gs', ':Git<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gs', ':Git<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gp', ':Git push<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gp', ':Git push<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gg', ':Git pull<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gg', ':Git pull<cr>', { noremap = true })
|
||||||
|
|
|
@ -148,11 +148,12 @@ end
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- golangci
|
-- golangci
|
||||||
|
-- go install https://github.com/klesh/golangci-lint-langserver
|
||||||
local configs = require 'lspconfig/configs'
|
local configs = require 'lspconfig/configs'
|
||||||
if not configs.golangcilsp then
|
if not configs.golangcilsp then
|
||||||
configs.golangcilsp = {
|
configs.golangcilsp = {
|
||||||
default_config = {
|
default_config = {
|
||||||
cmd = { 'golangci-lint-langserver' },
|
cmd = { 'golangci-lint-langserver', "--debug" },
|
||||||
root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
|
root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
|
||||||
init_options = {
|
init_options = {
|
||||||
command = { "golangci-lint", "run", "--out-format", "json",
|
command = { "golangci-lint", "run", "--out-format", "json",
|
||||||
|
@ -164,3 +165,22 @@ end
|
||||||
lspconfig.golangci_lint_ls.setup {
|
lspconfig.golangci_lint_ls.setup {
|
||||||
filetypes = { 'go', 'gomod' }
|
filetypes = { 'go', 'gomod' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
-- local function nvim_create_augroups(definitions)
|
||||||
|
-- for group_name, definition in pairs(definitions) do
|
||||||
|
-- vim.api.nvim_command('augroup ' .. group_name)
|
||||||
|
-- vim.api.nvim_command('autocmd!')
|
||||||
|
-- for _, def in ipairs(definition) do
|
||||||
|
-- local command = table.concat(vim.tbl_flatten { 'autocmd', def }, ' ')
|
||||||
|
-- vim.api.nvim_command(command)
|
||||||
|
-- end
|
||||||
|
-- vim.api.nvim_command('augroup END')
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- nvim_create_augroups({
|
||||||
|
-- go_save = {
|
||||||
|
-- { "BufWritePre", "*.go", "lua goimports(1000)" },
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
Loading…
Reference in New Issue
Block a user