nvim and tmux styling
This commit is contained in:
parent
21127d307d
commit
f5949b3d50
4 changed files with 41 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
alias a="tmux new-session -A -s main"
|
alias a="tmux new-session -A -s main"
|
||||||
alias cz="chezmoi"
|
alias cz="chezmoi"
|
||||||
alias gs="git status"
|
alias gs="git status"
|
||||||
|
alias pkgedit="nvim ~/.config/mgmt/packages"
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ missing=()
|
||||||
check_apply() {
|
check_apply() {
|
||||||
while IFS= read -r package; do
|
while IFS= read -r package; do
|
||||||
cmd=$(echo "$package" | cut -d\; -f1)
|
cmd=$(echo "$package" | cut -d\; -f1)
|
||||||
pkg=$(echo "$package" | grep -Eo "$(_os):[^ ]+" || echo ":$cmd")
|
pkg=$(echo "$package" | grep -Eo "$(_os):[^ ]*" || echo ":$cmd")
|
||||||
pkg=$(echo "$pkg" | cut -d: -f2)
|
pkg=$(echo "$pkg" | cut -d: -f2)
|
||||||
[ -n "$pkg" ] || next
|
[ -n "$pkg" ] || continue
|
||||||
|
|
||||||
command -v "$cmd" >/dev/null || missing+=( "$pkg" )
|
command -v "$cmd" >/dev/null || missing+=( "$pkg" )
|
||||||
done < ~/.config/mgmt/packages
|
done < ~/.config/mgmt/packages
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
entr
|
||||||
git
|
git
|
||||||
make
|
make
|
||||||
nvim; termux:neovim arch:neovim ubuntu:
|
nvim; termux:neovim arch:neovim ubuntu:
|
||||||
|
tailscale; termux:
|
||||||
|
tmux
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,44 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
-- loading lazy.nvim so that mappings are correct.
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
-- This is also a good place to setup other settings (vim.opt)
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = "\\"
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.whichwrap:append("<,>,h,l")
|
||||||
|
|
||||||
|
vim.opt.listchars = 'tab:┆-,trail:~,extends:>,precedes:<,nbsp:•'
|
||||||
|
vim.opt.list = true
|
||||||
|
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.splitright = true
|
||||||
|
|
||||||
|
function tblmerge(x, y) for k,v in pairs(y) do x[k] = v end return x end
|
||||||
|
|
||||||
|
local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, tblmerge({ noremap = true, silent = true}, opts or {})) end
|
||||||
|
function nmap(l, r, opt) map('n', l, r, opt) end
|
||||||
|
function imap(l, r, opt) map('i', l, r, opt) end
|
||||||
|
function vmap(l, r, opt) map('v', l, r, opt) end
|
||||||
|
|
||||||
|
|
||||||
|
-- Treat long lines as broken lines so you can move in them
|
||||||
|
nmap('j', 'gj')
|
||||||
|
nmap('k', 'gk')
|
||||||
|
|
||||||
|
-- maintain visual selection when changing indentation
|
||||||
|
vmap('<', '<gv')
|
||||||
|
vmap('>', '>gv')
|
||||||
|
|
||||||
|
nmap("<Leader>w", ":w<CR>")
|
||||||
|
|
||||||
|
nmap("<Leader>tn", ":tabnew<CR>")
|
||||||
|
nmap('<Leader>te', ':tabedit <c-r>=expand("%:p:h")<cr>/<cr>')
|
||||||
|
|
||||||
-- Setup lazy.nvim
|
-- Setup lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue