several updates, mostly with neovim

This commit is contained in:
Tyler Starr 2023-02-03 22:08:33 -08:00
parent 7ebad38454
commit 18dda5b1d5
13 changed files with 185 additions and 50 deletions

74
home/dot_config/lf/lfrc Normal file
View File

@ -0,0 +1,74 @@
# Basic Settings
set hidden true
set ignorecase true
set icons true
# Custom Functions
cmd mkdir ${{
printf "Directory Name: "
read ans
mkdir $ans
}}
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR $ans
}}
# Trash bindings
cmd trash ${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=${files%%;*}
trash-put "$(basename "$file")"
if [ "$files" = "$file" ]; then
files=''
else
files="${files#*;}"
fi
done
}}
cmd restore_trash ${{
trash-restore
}}
# use '<delete>' key for either 'trash' or 'delete' command
map m
map D trash
map mf mkfile
map md mkdir
# extract the current file with the right command
# (xkcd link: https://xkcd.com/1168/)
cmd extract ${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}
# compress current file or selected files with tar and gunzip
cmd tar ${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}
# compress current file or selected files with zip
cmd zip ${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}

View File

@ -1,5 +1,4 @@
local nnoremap = require("tstarr.keymap").nnoremap
local silent = { silent = true }
local wk = require("which-key")
require("harpoon").setup({
menu = {
@ -7,10 +6,14 @@ require("harpoon").setup({
}
})
nnoremap("<leader>qa", function() require("harpoon.mark").add_file() end, silent)
nnoremap("<leader>ql", function() require("harpoon.ui").toggle_quick_menu() end, silent)
nnoremap("<leader>1", function() require("harpoon.ui").nav_file(1) end, silent)
nnoremap("<leader>2", function() require("harpoon.ui").nav_file(2) end, silent)
nnoremap("<leader>3", function() require("harpoon.ui").nav_file(3) end, silent)
nnoremap("<leader>4", function() require("harpoon.ui").nav_file(4) end, silent)
wk.register({
q = {
name = "+harpoon",
["1"] = { function() require("harpoon.ui").nav_file(1) end, "Harpoon 1" },
["2"] = { function() require("harpoon.ui").nav_file(2) end, "Harpoon 2" },
["3"] = { function() require("harpoon.ui").nav_file(3) end, "Harpoon 3" },
["4"] = { function() require("harpoon.ui").nav_file(4) end, "Harpoon 4" },
a = { function() require("harpoon.mark").add_file() end, "Add File" },
l = { function() require("harpoon.ui").toggle_quick_menu() end, "List Files" }
},
}, { prefix = "<leader>" })

View File

@ -1,5 +1,8 @@
local Remap = require("tstarr.keymap")
local nnoremap = Remap.nnoremap
local silent = { silent = true }
local wk = require("which-key")
nnoremap("<leader>gg", "<cmd>LazyGit<CR>", silent)
wk.register({
g = {
name = "+git",
g = { "<cmd>LazyGit<CR>", "Lazygit" },
},
}, { prefix = "<leader>" })

View File

@ -1,14 +1,22 @@
local nnoremap = require("tstarr.keymap").nnoremap
local wk = require("which-key")
nnoremap("<leader>pv", "<cmd>Ex<CR>")
nnoremap("<leader>tn", "<cmd>tabnew<CR>")
nnoremap("<leader>th", "<cmd>tabn<CR>")
nnoremap("<leader>tl", "<cmd>tabp<CR>")
nnoremap("<leader>tc", "<cmd>tabc<CR>")
nnoremap("<leader>h", "<C-w>h")
nnoremap("<leader>j", "<C-w>j")
nnoremap("<leader>k", "<C-w>k")
nnoremap("<leader>l", "<C-w>l")
nnoremap("<leader>H", "<cmd>wincmd p<CR>")
wk.register({
-- netrw commands
n = {
name = "+netrw",
v = { "<cmd>Ex<CR>", "Explorer" }
},
-- tab commands
t = {
name = "+tab",
f = { "<cmd>tabnew<CR>", "New" },
g = { "<cmd>tabn<CR>", "Next" },
b = { "<cmd>tabp<CR>","Previous" },
h = { "<cmd>tabc<CR>", "Close" }
},
-- pane movement commands
h = { "<C-w>h", "Pane Left" },
j = { "<C-w>j", "Pane Down" },
k = { "<C-w>k", "Pane Up" },
l = { "<C-w>l", "Pane Right" }
}, { prefix = "<leader>" })

View File

@ -1,20 +1,12 @@
local Remap = require("tstarr.keymap")
local nnoremap = Remap.nnoremap
nnoremap("<leader>ff", function ()
require('telescope.builtin').find_files({hidden=true, no_ignore=true})
end)
nnoremap("<leader>fg", function ()
require('telescope.builtin').live_grep()
end)
nnoremap("<leader>fb", function ()
require('telescope.builtin').buffers()
end)
nnoremap("<leader>fh", function ()
require('telescope.builtin').help_tags()
end)
nnoremap("<leader>p", function ()
require('telescope').extensions.project.project()
end)
local wk = require("which-key")
wk.register({
p = { function () require('telescope').extensions.project.project() end, "Project" },
f = {
name = "+telescope",
f = { function () require('telescope.builtin').find_files() end, "Files" },
g = { function () require('telescope.builtin').live_grep() end, "Ripgrep" },
b = { function () require('telescope.builtin').buffers() end, "Buffers" },
h = { function () require('telescope.builtin').help_tags() end, "Help" }
},
}, { prefix = "<leader>" })

View File

@ -1,4 +1,9 @@
local nnoremap = require("tstarr.keymap").nnoremap
local wk = require("which-key")
nnoremap("<leader>u", "<cmd>UndotreeFocus<CR>")
nnoremap("<leader>ut", "<cmd>UndotreeToggle<CR>")
wk.register({
q = {
name = "+undotree",
u = { "<cmd>UndotreeFocus<CR>", "Focus Tree" },
t = { "<cmd>UndotreeToggle<CR>", "Toggle Tree" }
},
}, { prefix = "<leader>" })

View File

@ -0,0 +1,19 @@
local wk = require("which-key")
wk.register({
w = {
name = "+vimwiki",
i = { "<cmd>VimwikiDiaryIndex<CR>", "Diary Index" },
s = { "<cmd>VimwikiUISelect<CR>", "Select Index" },
t = { "<cmd>VimwikiTabIndex<CR>", "Index Tab" },
w = { "<cmd>VimwikiIndex<CR>", "Index" },
["<space>"] = {
name = "+diary",
i = { "<cmd>VimwikiDiaryGenerateLinks<CR>", "Generate Links" },
m = { "<cmd>VimwikiMakeTomorrowDiaryNote<CR>", "Make Tomorrow Note" },
t = { "<cmd>VimwikiTabMakeDiaryNote<CR>", "Make Today Note" },
w = { "<cmd>VimwikiDiaryNote<CR>", "Today Note" },
y = { "<cmd>VimwikiMakeYesterdayDiaryNote<CR>", "Make Yesterday Note" }
}
},
}, { prefix = "<leader>" })

View File

@ -1,3 +1,5 @@
require("tstarr.set")
require("tstarr.packer")
require("tstarr.telescope")
require("tstarr.vimwiki")
require("tstarr.which-key")

View File

@ -35,5 +35,7 @@ return require('packer').startup(function(use)
use ('saadparwaiz1/cmp_luasnip')
use ('alker0/chezmoi.vim')
use ('nathangrigg/vim-beancount')
use ('vimwiki/vimwiki')
use ('folke/which-key.nvim')
end)

View File

@ -1,5 +1,3 @@
--require'telescope'.load_extension('project')
require('telescope').setup {
extensions = {
project = {

View File

@ -0,0 +1,16 @@
vim.g.vimwiki_list = {
{
path = '~/documents/vimwiki/main',
syntax = 'markdown',
ext = '.md'
}
}
vim.g.vimwiki_ext2syntax = {
['.md'] = 'markdown',
['.markdown'] = 'markdown',
['.mdown'] = 'markdown',
}
vim.g.vimwiki_global_ext = 0 -- don't treat all md files as vimwiki
vim.g.vimwiki_markdown_link_ext = 1

View File

@ -0,0 +1,7 @@
vim.o.timeout = true
vim.o.timeoutlen = 300
require('which-key').setup{
}

View File

@ -4,6 +4,7 @@
- neovim # Vim-fork focused on extensibility and agility
- task # Command-line TODO list manager
- timewarrior # Timewarrior tracks and reports time
- python3-tasklib # Library for interacting with taskwarrior databases (Python3)
- vifm # Ncurses-based file manager with vi-like keybindings
- zsh # Z SHell
- tmux # Terminal Multiplexer
@ -17,6 +18,11 @@
state: present
become: true
- name: Install terminal python packages
ansible.builtin.pip:
name:
- pynvim
- name: Install terminal xbps-src packages
tags: ["src"]
include_tasks: ../include/xbps-src.yml