updates
This commit is contained in:
parent
78e8d4cd39
commit
ceb75c42fd
14 changed files with 325 additions and 28 deletions
|
|
@ -18,6 +18,7 @@ in
|
|||
XDG_CURRENT_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
XDG_SESSION_DESKTOP = "Hyprland";
|
||||
XCURSOR_SIZE = "108";
|
||||
};
|
||||
sessionVariables = {
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
|
|
|
|||
9
modules/desktop/virtualisation/virtlib.nix
Normal file
9
modules/desktop/virtualisation/virtlib.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
|
||||
virtualisation.libvirtd.host.enable = true;
|
||||
users.extraGroups.libvirtd.members = [ "${user}" ];
|
||||
|
||||
}
|
||||
|
||||
13
modules/editors/lvim/home.nix
Normal file
13
modules/editors/lvim/home.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.file."/home/glen/.config/lvim" = {
|
||||
source = ./lvim;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
5
modules/editors/lvim/lvim/config.lua
Normal file
5
modules/editors/lvim/lvim/config.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
reload "user.plugins"
|
||||
reload "user.surround"
|
||||
reload "user.dial"
|
||||
reload "user.oil"
|
||||
reload "user.keymaps"
|
||||
70
modules/editors/lvim/lvim/lua/user/dial.lua
Normal file
70
modules/editors/lvim/lvim/lua/user/dial.lua
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
local status_ok, dial_config = pcall(require, "dial.config")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local augend = require "dial.augend"
|
||||
dial_config.augends:register_group {
|
||||
default = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.constant.new { elements = { "let", "const" } },
|
||||
},
|
||||
visual = {
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.date.alias["%Y/%m/%d"],
|
||||
augend.constant.alias.alpha,
|
||||
augend.constant.alias.Alpha,
|
||||
},
|
||||
mygroup = {
|
||||
augend.constant.new {
|
||||
elements = { "and", "or" },
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "True", "False" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "public", "private" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "sad", "sad" },
|
||||
word = true,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.constant.new {
|
||||
elements = { "&&", "||" },
|
||||
word = false,
|
||||
cyclic = true,
|
||||
},
|
||||
augend.date.alias["%m/%d/%Y"], -- date (02/19/2022, etc.)
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
augend.integer.alias.decimal,
|
||||
augend.integer.alias.hex,
|
||||
augend.semver.alias.semver
|
||||
},
|
||||
}
|
||||
|
||||
local map = require "dial.map"
|
||||
|
||||
-- change augends in VISUAL mode
|
||||
vim.api.nvim_set_keymap("n", "<C-a>", map.inc_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("n", "<C-x>", map.dec_normal "mygroup", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-a>", map.inc_normal "visual", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<C-x>", map.dec_normal "visual", { noremap = true })
|
||||
|
||||
vim.cmd [[
|
||||
" enable only for specific FileType
|
||||
autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "<C-a>", require("dial.map").inc_normal("typescript"), {noremap = true})
|
||||
]]
|
||||
1
modules/editors/lvim/lvim/lua/user/keymaps.lua
Normal file
1
modules/editors/lvim/lvim/lua/user/keymaps.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "-", require("oil").open, { desc = "Open parent directory" })
|
||||
127
modules/editors/lvim/lvim/lua/user/oil.lua
Normal file
127
modules/editors/lvim/lvim/lua/user/oil.lua
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
require("oil").setup({
|
||||
-- Id is automatically added at the beginning, and name at the end
|
||||
-- See :help oil-columns
|
||||
columns = {
|
||||
"icon",
|
||||
-- "permissions",
|
||||
-- "size",
|
||||
-- "mtime",
|
||||
},
|
||||
-- Buffer-local options to use for oil buffers
|
||||
buf_options = {
|
||||
buflisted = false,
|
||||
bufhidden = "hide",
|
||||
},
|
||||
-- Window-local options to use for oil buffers
|
||||
win_options = {
|
||||
wrap = false,
|
||||
signcolumn = "no",
|
||||
cursorcolumn = false,
|
||||
foldcolumn = "0",
|
||||
spell = false,
|
||||
list = false,
|
||||
conceallevel = 3,
|
||||
concealcursor = "n",
|
||||
},
|
||||
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
|
||||
default_file_explorer = true,
|
||||
-- Restore window options to previous values when leaving an oil buffer
|
||||
restore_win_options = true,
|
||||
-- Skip the confirmation popup for simple operations
|
||||
skip_confirm_for_simple_edits = false,
|
||||
-- Deleted files will be removed with the trash_command (below).
|
||||
delete_to_trash = false,
|
||||
-- Change this to customize the command used when deleting to trash
|
||||
trash_command = "trash-put",
|
||||
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
|
||||
prompt_save_on_select_new_entry = true,
|
||||
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
|
||||
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
|
||||
-- Additionally, if it is a string that matches "actions.<name>",
|
||||
-- it will use the mapping at require("oil.actions").<name>
|
||||
-- Set to `false` to remove a keymap
|
||||
-- See :help oil-actions for a list of all available actions
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-s>"] = "actions.select_vsplit",
|
||||
["<C-h>"] = "actions.select_split",
|
||||
["<C-t>"] = "actions.select_tab",
|
||||
["<C-p>"] = "actions.preview",
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
-- Set to false to disable all of the above keymaps
|
||||
use_default_keymaps = true,
|
||||
view_options = {
|
||||
-- Show files and directories that start with "."
|
||||
show_hidden = false,
|
||||
-- This function defines what is considered a "hidden" file
|
||||
is_hidden_file = function(name, bufnr)
|
||||
return vim.startswith(name, ".")
|
||||
end,
|
||||
-- This function defines what will never be shown, even when `show_hidden` is set
|
||||
is_always_hidden = function(name, bufnr)
|
||||
return false
|
||||
end,
|
||||
},
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
-- Padding around the floating window
|
||||
padding = 2,
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 10,
|
||||
},
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
override = function(conf)
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
-- Configuration for the actions floating preview window
|
||||
preview = {
|
||||
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- min_width and max_width can be a single value or a list of mixed integer/float types.
|
||||
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
|
||||
max_width = 0.9,
|
||||
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
|
||||
min_width = { 40, 0.4 },
|
||||
-- optionally define an integer/float for the exact width of the preview window
|
||||
width = nil,
|
||||
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- min_height and max_height can be a single value or a list of mixed integer/float types.
|
||||
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
|
||||
max_height = 0.9,
|
||||
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
|
||||
min_height = { 5, 0.1 },
|
||||
-- optionally define an integer/float for the exact height of the preview window
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
-- Configuration for the floating progress window
|
||||
progress = {
|
||||
max_width = 0.9,
|
||||
min_width = { 40, 0.4 },
|
||||
width = nil,
|
||||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
minimized_border = "none",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
29
modules/editors/lvim/lvim/lua/user/plugins.lua
Normal file
29
modules/editors/lvim/lvim/lua/user/plugins.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- Additional Plugins
|
||||
lvim.plugins = {
|
||||
"kylechui/nvim-surround",
|
||||
"monaqa/dial.nvim",
|
||||
{
|
||||
"cbochs/grapple.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
},
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
},
|
||||
}
|
||||
21
modules/editors/lvim/lvim/lua/user/surround.lua
Normal file
21
modules/editors/lvim/lvim/lua/user/surround.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
local status_ok, surround = pcall(require, "nvim-surround")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
surround.setup {
|
||||
keymaps = { -- vim-surround style keymaps
|
||||
insert = "<C-g>s",
|
||||
insert_line = "<C-g>S",
|
||||
normal = "s",
|
||||
normal_cur = "ss",
|
||||
normal_line = "S",
|
||||
normal_cur_line = "SS",
|
||||
visual = "s",
|
||||
visual_line = "gS",
|
||||
delete = "ds",
|
||||
change = "cs",
|
||||
},
|
||||
}
|
||||
|
||||
vim.cmd [[nmap <leader>' siw']]
|
||||
|
|
@ -50,7 +50,7 @@ create_detached_session() {
|
|||
(TMUX=''
|
||||
tmux new-session -Ad -s "$session_name" -c "$path_name"
|
||||
tmux split-window -vb -t "$session_name" -c "$path_name" -p 70
|
||||
tmux send-keys -t "$session_name" "nvim '+Telescope find_files'" Enter
|
||||
tmux send-keys -t "$session_name" "/home/glen/.local/bin/lvim '+Telescope find_files'" Enter
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
octal = "stat -c '%a %n'";
|
||||
|
||||
v = "nix run ~/Projects/nvim-flake --";
|
||||
lvim = "/home/glen/.local/bin/lvim";
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue