diff --git a/flake.nix b/flake.nix index 98211a5..6b023ed 100644 --- a/flake.nix +++ b/flake.nix @@ -121,6 +121,7 @@ ./nixos/dotfiles ./nixos/configs/stylix + ./nixos/configs/ld.nix ./nixos/configs/lix.nix ./nixos/configs/nix.nix ./nixos/configs/ccache.nix diff --git a/nixos/configs/ld.nix b/nixos/configs/ld.nix new file mode 100644 index 0000000..291aab1 --- /dev/null +++ b/nixos/configs/ld.nix @@ -0,0 +1,9 @@ +# +# Nix-ld configuration. +# +{pkgs, ...}: { + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + + ]; +} diff --git a/nixos/packages/gui.pkgs.nix b/nixos/packages/gui.pkgs.nix index 50846d1..515991b 100644 --- a/nixos/packages/gui.pkgs.nix +++ b/nixos/packages/gui.pkgs.nix @@ -103,9 +103,7 @@ with pkgs; supersonic # Development. - jetbrains.rust-rover - jetbrains.webstorm - jetbrains.clion + jetbrains-toolbox # Xwayland support. xwayland diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 6c80eed..f994854 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,86 +1,86 @@ vim.cmd([[ - syntax on - filetype plugin indent on + syntax on + filetype plugin indent on - let mapleader="," + let mapleader="," - """ Options - set number " Show line numbers. - set modeline " Allow vim commands in text file comments. - set undofile " Persistent undo tree. - set incsearch " Incremental search. - set tabstop=4 " Number of visual spaces to be displayed per HT. - set expandtab " Expand tabs to spaces by default. - set shiftwidth=0 " Use tabstop value for indenting. - set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor. - set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge. - set mouse=n " Enable the mouse in normal mode. - set colorcolumn=120 - set wildmenu " Tab-complete command menu. - set wildmode=longest:full,full " Most bash-like way. - set wildignorecase " Ignore case when completing. - set splitright " Make :vsplit put the new window on the right. - set splitbelow " Make :split put the new window on the bottom. - set foldlevel=5 " Don't fold almost anything by default. - set hidden " Allow for hidden, modified but not written buffers. - set bufhidden=hide " Hide buffers instead of deleting or unloading them. - set ignorecase - set smartcase - set gdefault - set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin. - set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly. - " Autowrap comments using textwidth, inserting the comment leader, - " and remove the comment leader when joining lines when it makes sense. - set formatoptions=cj - " Don't display . on folds. - set fillchars=fold:\ - set diffopt=algorithm:patience - set fsync " Syncs the filesystem after :write. - set nowrap + """ Options + set number " Show line numbers. + set modeline " Allow vim commands in text file comments. + set undofile " Persistent undo tree. + set incsearch " Incremental search. + set tabstop=4 " Number of visual spaces to be displayed per HT. + set expandtab " Expand tabs to spaces by default. + set shiftwidth=0 " Use tabstop value for indenting. + set scrolloff=2 " Keep 2 lines between the end of the buffer and the cursor. + set sidescrolloff=2 " Keep 2 characters between the current column and the screen edge. + set mouse=n " Enable the mouse in normal mode. + set colorcolumn=120 + set wildmenu " Tab-complete command menu. + set wildmode=longest:full,full " Most bash-like way. + set wildignorecase " Ignore case when completing. + set splitright " Make :vsplit put the new window on the right. + set splitbelow " Make :split put the new window on the bottom. + set foldlevel=5 " Don't fold almost anything by default. + set hidden " Allow for hidden, modified but not written buffers. + set bufhidden=hide " Hide buffers instead of deleting or unloading them. + set ignorecase + set smartcase + set gdefault + set cindent " A good basis/default for many languages, though this is usually overridden by the filetype plugin. + set cinoptions=l1,j1 " Indent case blocks correct, and indent Java anonymous classes correctly. + " Autowrap comments using textwidth, inserting the comment leader, + " and remove the comment leader when joining lines when it makes sense. + set formatoptions=cj + " Don't display . on folds. + set fillchars=fold:\ + set diffopt=algorithm:patience + set fsync " Syncs the filesystem after :write. + set nowrap - set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold. - set noshowmode " We're using lualine, so showing the mode in the command line is redundant. + set updatetime=1000 "Lets languageservers update faster, and shortens the time for CursorHold. + set noshowmode " We're using lualine, so showing the mode in the command line is redundant. - " Have the visual-selection indent commands re-highlight the last visual selection after indenting. - vnoremap > >gv - vnoremap < >gv + vnoremap < + " Don't use backtick for anything, as it's our wezterm leader key and this leads + " to typos. + map ` - " Leader Q should banish the current window. - map q :only \| :q + " Leader Q should banish the current window. + map q :only \| :q - " Leader W should save and then banish the current window. - map q :only \| :wq + " Leader W should save and then banish the current window. + map q :only \| :wq - " Fold augroups, functions, Lua, and Python - let g:vimsyn_folding = 'aflP' + " Fold augroups, functions, Lua, and Python + let g:vimsyn_folding = 'aflP' - " Support embedded Lua and Python. - let g:vimsyn_embed = 'lP' + " Support embedded Lua and Python. + let g:vimsyn_embed = 'lP' - " Highlight whitespace errors. - let g:c_space_errors = 1 - let g:python_space_error_highlight = 1 + " Highlight whitespace errors. + let g:c_space_errors = 1 + let g:python_space_error_highlight = 1 - let g:python_highlight_builtins = 1 - let g:python_highlight_builtin_funcs = 1 - let g:python_highlight_builtin_types = 1 - let g:python_highlight_exceptions = 1 - let g:python_highlight_string_formatting = 1 - let g:python_highlight_string_format = 1 - let g:python_highlight_indent_errors = 1 - let g:python_highlight_space_errors = 1 - let g:python_highlight_class_vars = 1 + let g:python_highlight_builtins = 1 + let g:python_highlight_builtin_funcs = 1 + let g:python_highlight_builtin_types = 1 + let g:python_highlight_exceptions = 1 + let g:python_highlight_string_formatting = 1 + let g:python_highlight_string_format = 1 + let g:python_highlight_indent_errors = 1 + let g:python_highlight_space_errors = 1 + let g:python_highlight_class_vars = 1 - let g:xsh_highlight_all = v:true + let g:xsh_highlight_all = v:true - let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } } + let g:NERDCustomDelimiters = { 'dosini': { 'left': '#' }, 'xonsh': { 'left': '#' } } - " Use truecolor. - set termguicolors + " Use truecolor. + set termguicolors " Disable relative numbering, if anything turns it on. set nornu! diff --git a/nvim/lua/plugins/core.lua b/nvim/lua/plugins/core.lua index af4fa0b..4d7ba00 100644 --- a/nvim/lua/plugins/core.lua +++ b/nvim/lua/plugins/core.lua @@ -1,22 +1,22 @@ return { - { - "LazyVim/LazyVim", - opts = { - colorscheme = function() end, + { + "LazyVim/LazyVim", + opts = { + colorscheme = function() end, - defaults = { - autocmds = true, - keymaps = true, - }, + defaults = { + autocmds = true, + keymaps = true, + }, - news = { - lazyvim = false, - neovim = false, - }, + news = { + lazyvim = false, + neovim = false, + }, -- icons used by other plugins -- stylua: ignore - icons = { + icons = { misc = { dots = "󰇘", }, @@ -80,42 +80,42 @@ return { Variable = "󰀫 ", }, }, - ---@type table? - kind_filter = { - default = { - "Class", - "Constructor", - "Enum", - "Field", - "Function", - "Interface", - "Method", - "Module", - "Namespace", - "Package", - "Property", - "Struct", - "Trait", - }, - markdown = false, - help = false, - -- you can specify a different filter for each filetype - lua = { - "Class", - "Constructor", - "Enum", - "Field", - "Function", - "Interface", - "Method", - "Module", - "Namespace", - -- "Package", -- remove package since luals uses it for control flow structures - "Property", - "Struct", - "Trait", - }, - }, - }, - }, + ---@type table? + kind_filter = { + default = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + "Package", + "Property", + "Struct", + "Trait", + }, + markdown = false, + help = false, + -- you can specify a different filter for each filetype + lua = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + -- "Package", -- remove package since luals uses it for control flow structures + "Property", + "Struct", + "Trait", + }, + }, + }, + }, } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 950573b..19d9454 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -1,11 +1,11 @@ return { - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "nil", - "pyright", - }, - }, - }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "nil", + "basedpyright", + }, + }, + }, } diff --git a/nvim/lua/plugins/regular-ui.lua b/nvim/lua/plugins/regular-ui.lua index a8b97bd..761d1ff 100644 --- a/nvim/lua/plugins/regular-ui.lua +++ b/nvim/lua/plugins/regular-ui.lua @@ -1,4 +1,4 @@ return { - -- disable the weird UI provided by noice.nvim - { "folke/noice.nvim", enabled = false }, + -- disable the weird UI provided by noice.nvim + { "folke/noice.nvim", enabled = false }, } diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..a4bd51a --- /dev/null +++ b/nvim/lua/plugins/snacks.lua @@ -0,0 +1,96 @@ +-- lazy.nvim +return { + "folke/snacks.nvim", + ---@type snacks.Config + opts = { + image = {}, + dashboard = { + ---@class snacks.dashboard.Config + ---@field enabled? boolean + ---@field sections snacks.dashboard.Section + ---@field formats table + width = 70, + row = nil, -- dashboard position. nil for center + col = nil, -- dashboard position. nil for center + pane_gap = 4, -- empty columns between vertical panes + autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence + preset = { + pick = nil, + keys = { + { + icon = " ", + key = "f", + desc = "Find File", + action = ":lua Snacks.dashboard.pick('files')", + }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { + icon = " ", + key = "g", + desc = "Find Text", + action = ":lua Snacks.dashboard.pick('live_grep')", + }, + { + icon = " ", + key = "r", + desc = "Recent Files", + action = ":lua Snacks.dashboard.pick('oldfiles')", + }, + { + icon = " ", + key = "c", + desc = "Config", + action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})", + }, + { icon = " ", key = "s", desc = "Restore Session", section = "session" }, + { + icon = "󰒲 ", + key = "L", + desc = "Lazy", + action = ":Lazy", + enabled = package.loaded.lazy ~= nil, + }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + -- Used by the `header` section + header = [[ +██╗ ██╗████████╗███████╗███╗ ███╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ +██║ ██╔╝╚══██╔══╝██╔════╝████╗ ████║██║ ██╔╝██║ ██║██║████╗ ████║ +█████╔╝ ██║ █████╗ ██╔████╔██║█████╔╝ ██║ ██║██║██╔████╔██║ +██╔═██╗ ██║ ██╔══╝ ██║╚██╔╝██║██╔═██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║ +██║ ██╗ ██║ ███████╗██║ ╚═╝ ██║██║ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║ +╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]], + }, + -- item field formatters + formats = { + icon = function(item) + if item.file and item.icon == "file" or item.icon == "directory" then + return M.icon(item.file, item.icon) + end + return { item.icon, width = 2, hl = "icon" } + end, + footer = { "%s", align = "center" }, + header = { "%s", align = "center" }, + file = function(item, ctx) + local fname = vim.fn.fnamemodify(item.file, ":~") + fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname + if #fname > ctx.width then + local dir = vim.fn.fnamemodify(fname, ":h") + local file = vim.fn.fnamemodify(fname, ":t") + if dir and file then + file = file:sub(-(ctx.width - #dir - 2)) + fname = dir .. "/…" .. file + end + end + local dir, file = fname:match("^(.*)/(.+)$") + return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } } + end, + }, + sections = { + { section = "header" }, + { section = "keys", gap = 1, padding = 1 }, + { section = "startup" }, + }, + }, + }, +}