Add nvim config and improve broot + git aliases

main
Julius Riegel 8 months ago
parent ca1cdb47e2
commit 541ea747f4

@ -12,11 +12,10 @@ icon_theme = "vscode"
"**/out" = "no-enter"
[[verbs]]
invocation = "edit"
key = "enter"
shortcut = "e"
external = "nu {{dirs.data}}/scripts/ide.nu open-file '{file}'"
apply_to = "file"
apply_to = "any"
leave_broot = false
[[verbs]]
@ -31,3 +30,19 @@ shortcut = "gd"
leave_broot = "false"
execution = "git difftool -y {file}"
apply_to = "file"
[[verbs]]
invocation = "open_leave"
key = "alt-enter"
shortcut = "ol"
external = "nu -c \"touch {directory}/{name}\""
apply_to = "any"
[[verbs]]
invocation = "open_stay"
key = "enter"
shortcut = "os"
external = "nu -c \"touch {directory}/{name}\""
leave_broot = false
apply_to = "any"

@ -0,0 +1,111 @@
--[[
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
`lvim` is the global options object
]]
-- vim options
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.relativenumber = true
-- general
lvim.log.level = "info"
lvim.format_on_save = {
enabled = true,
pattern = "*.lua",
timeout = 1000,
}
-- to disable icons and use a minimalist setup, uncomment the following
-- lvim.use_icons = false
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
lvim.leader = "space"
-- add your own keymapping
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
-- -- Use which-key to add extra bindings with the leader-key prefix
-- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
-- -- Change theme settings
-- lvim.colorscheme = "lunar"
lvim.builtin.alpha.active = true
lvim.builtin.alpha.mode = "dashboard"
lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
-- Automatically install missing parsers when entering buffer
lvim.builtin.treesitter.auto_install = true
-- lvim.builtin.treesitter.ignore_install = { "haskell" }
-- -- always installed on startup, useful for parsers without a strict filetype
-- lvim.builtin.treesitter.ensure_installed = { "comment", "markdown_inline", "regex" }
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
-- --- disable automatic installation of servers
-- lvim.lsp.installer.setup.automatic_installation = false
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
-- require("lvim.lsp.manager").setup("pyright", opts)
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
-- return server ~= "emmet_ls"
-- end, lvim.lsp.automatic_configuration.skipped_servers)
-- -- you can set a custom on_attach function that will be used for all the language servers
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
-- lvim.lsp.on_attach_callback = function(client, bufnr)
-- local function buf_set_option(...)
-- vim.api.nvim_buf_set_option(bufnr, ...)
-- end
-- --Enable completion triggered by <c-x><c-o>
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- end
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
-- local formatters = require "lvim.lsp.null-ls.formatters"
-- formatters.setup {
-- { command = "stylua" },
-- {
-- command = "prettier",
-- extra_args = { "--print-width", "100" },
-- filetypes = { "typescript", "typescriptreact" },
-- },
-- }
-- local linters = require "lvim.lsp.null-ls.linters"
-- linters.setup {
-- { command = "flake8", filetypes = { "python" } },
-- {
-- command = "shellcheck",
-- args = { "--severity", "warning" },
-- },
-- }
-- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
-- lvim.plugins = {
-- {
-- "folke/trouble.nvim",
-- cmd = "TroubleToggle",
-- },
-- }
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "zsh",
-- callback = function()
-- -- let treesitter use bash highlight for zsh files as well
-- require("nvim-treesitter.highlight").attach(0, "bash")
-- end,
-- })

@ -15,5 +15,12 @@ alias `shx` = sudo -E helix -c '{{dirs.config}}/helix/config.toml'
{{#if-installed nix}}
alias devshell = nix develop -c $env.SHELL
{{/if-installed}}
{{#if-installed git}}
alias gc = git commit
alias gp = git push
alias ga = git add
alias ga. = git add .
alias gu = git pull
{{/if-installed}}
def --env `silo cd` [] { silo repo | cd $in }

@ -19,5 +19,6 @@ config:needs("systemctl", "systemd")
config:needs("wezterm", "wezterm")
config:needs("zellij", "zellij")
config:needs("starship", "starship")
config:needs("lvim", "lvim")
return config

@ -1,13 +1,16 @@
#!/bin/env nu
def main [] {
def --env main [] {
if $env.ZELLIJ? == null {
let tmpdir = init
zellij --layout {{dirs.config}}/zellij/development.toml --session (session-name)
rm -r $tmpdir
} else {
zellij action new-tab --layout {{dirs.config}}/zellij/development.toml --name (tab-name)
}
}
def `main open-file` [path: string] {
match ($path | path parse | get extension | str downcase) {
"png" => { open-image $path }
@ -44,3 +47,15 @@ def tab-name [] {
let dirname = $env.PWD | path parse | get stem
$"Editor \(($dirname)\)"
}
def --env init [] {
let tmpdir = mktemp -d --suffix "-ide"
let tmpbin = ($tmpdir | path join "bin")
mkdir $tmpbin
let new_open = ($tmpbin | path join "xdg-open")
"#!/bin/bash\nnu {{dirs.data}}/scripts/ide.nu open-file $*\n" | save -f $new_open
chmod +x $new_open
$env.PATH = ($env.PATH | prepend $tmpbin)
$tmpdir
}

@ -107,6 +107,9 @@ config.modules = {
},
aws = mod {
'awscli2'
},
lunarvim = mod {
'lunarvim'
}
}

Loading…
Cancel
Save