diff --git a/README.md b/README.md index 6e4c4008..05b30fd9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Dotfiles -These are dotfiles for my Linux, MacOS and Windows machines +These are dotfiles for my Linux and MacOS machines ### Linux - OS: NixOS @@ -16,14 +16,6 @@ These are dotfiles for my Linux, MacOS and Windows machines - WM: [yabai](https://github.com/koekeishiya/yabai) - Terminal: wezterm -### Windows -- OS: Windows 11 -- Shell: nushell -- Editor: nvim / neovide / helix -- WM: Vanilla / -- Terminal: Vanilla / wezterm - - ### For nix I'm a recent convert to NixOS from ArchLinux and have been usin it as primary os as well as a package manager on macos so the flake.nix contains configuration for both nix-darwin as well as nixos. It also contains a native home-manager module configuration for non-nixos devices ( like a SteamDeck ). diff --git a/common/nvim.nix b/common/nvim.nix index 7423f5f7..f7bde12b 100644 --- a/common/nvim.nix +++ b/common/nvim.nix @@ -20,6 +20,7 @@ lua = true; }) mappings; + border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"]; in { imports = [inputs.nixvim.homeManagerModules.nixvim]; programs.nixvim = { @@ -36,7 +37,10 @@ in { # "${pkgs.nixfmt}/bin/nixfmt" # "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ]; + # nix.flake.autoArchive = true; }; + marksman.enable = true; + nushell.enable = true; clangd.enable = true; lua-ls.enable = true; jsonls.enable = true; @@ -88,18 +92,17 @@ in { }; window = { completion = { - border = "cmp.config.window.bordered()"; + inherit border; }; documentation = { - border = "cmp.config.window.bordered()"; + inherit border; }; }; mapping = { "" = "cmp.mapping.confirm({select = true})"; "" = "cmp.mapping.complete()"; - # "" = "cmp.mapping.complete()"; - "" = "cmp.config.next"; - "" = "cmp.config.prev"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; }; snippet.expand = /* @@ -180,19 +183,19 @@ in { commentary.enable = true; surround.enable = true; which-key.enable = true; - # nvim-ufo = { - # enable = true; - # closeFoldKinds = null; - # providerSelector = - # /* - # lua - # */ - # '' - # function(bufnr, filetype, buftype) - # return {'treesitter', 'indent'} - # end - # ''; - # }; + nvim-ufo = { + enable = true; + closeFoldKinds = null; + # providerSelector = + # /* + # lua + # */ + # '' + # function(bufnr, filetype, buftype) + # return {'treesitter', 'indent'} + # end + # ''; + }; fugitive.enable = true; markdown-preview = { enable = true; @@ -344,6 +347,24 @@ in { }; }; + autoCmd = [ + { + event = ["BufEnter" "BufWinEnter"]; + pattern = "*.norg"; + command = "set conceallevel=3"; + } + { + event = ["BufWinLeave"]; + pattern = "*.*"; + command = "mkview"; + } + { + event = ["BufWinEnter"]; + pattern = "*.*"; + command = "silent loadview"; + } + ]; + extraConfigLua = let codelldb = if device.isLinux @@ -360,14 +381,22 @@ in { lua */ '' - require'neotest'.setup({ - adapters = { - -- require('neotest-rust') { - -- args = { "--no-capture" }, - -- } - require('rustaceanvim.neotest'), - } - }) + function catcher(callback) + do + success, output = pcall(callback) + if not success then + print("Failed to setup: " .. output) + end + end + end + + catcher(function() + require'neotest'.setup({ + adapters = { + require('rustaceanvim.neotest'), + } + }) + end) do function setup() @@ -380,7 +409,7 @@ in { end - require('telescope').load_extension("dap") + -- require('telescope').load_extension("dap") -- require('telescope').load_extension("rest") require('telescope').load_extension("neorg") @@ -395,82 +424,16 @@ in { panel = { enabled = true }, }) - -- require 'fidget'.setup() - -- ======================================================================= - -- nvim-cmp - -- ======================================================================= - -- local cmp = require("cmp") - -- cmp.setup({ - -- view = { - -- entries = { name = 'custom', selection_order = 'near_cursor' } - -- }, - -- snippet = { - -- expand = function(args) - -- require('luasnip').lsp_expand(args.body) - -- end - -- }, - -- window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - -- }, - -- sources = cmp.config.sources({ - -- { name = "copilot", }, - -- { name = 'buffer' }, - -- { name = 'nvim_lsp' }, - -- { name = 'luasnip' }, - -- { name = 'treesitter' }, - -- { name = 'path' }, - -- { name = 'git' }, - -- { name = 'tmux' } - -- }), - -- mapping = cmp.mapping.preset.insert({ - -- [''] = cmp.mapping.confirm(), - -- [''] = cmp.mapping.complete(), - -- -- [''] = cmp.mapping.complete(), - -- [''] = cmp.config.next, - -- [''] = cmp.config.prev, - -- }) - -- }) - - -- cmp.setup.cmdline({ '/', '?' }, { - -- mapping = cmp.mapping.preset.cmdline { - -- -- [''] = cmp.config.disable, - -- -- [''] = cmp.config.disable, - -- }, - -- sources = { - -- { name = 'buffer' } - -- } - -- }) - -- cmp.setup.cmdline(':', { - -- mapping = cmp.mapping.preset.cmdline { - -- -- [''] = cmp.config.disable, - -- -- [''] = cmp.config.disable, - -- }, - -- -- mapping = cmp.mapping.preset.cmdline(), - -- sources = cmp.config.sources({ - -- { name = 'path' } - -- }, { - -- { name = 'cmdline' } - -- }) - -- }) - -- cmp.setup.filetype('gitcommit', { - -- sources = cmp.config.sources({ - -- { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). - -- }, { - -- { name = 'buffer' }, - -- }) - -- }) - - require('crates').setup() - require('outline').setup() + catcher(require('crates').setup) + catcher(require('outline').setup) require 'FTerm'.setup({ - border = 'double', + border = 'single', dimensions = { - height = 0.95, - width = 0.95, + height = 0.99, + width = 0.99, }, - cmd = "fish", + cmd = "${pkgs.fish}/bin/fish", blend = 10, }) @@ -499,16 +462,12 @@ in { } } }) - vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { - pattern = {"*.norg"}, - command = "set conceallevel=3" - }) require('chatgpt').setup({ api_key_cmd = "rbw get platform.openai.com", }) - require"octo".setup({ + require('octo').setup({ use_local_fs = false, enable_builtin = false, default_remote = {"upstream", "origin"}; diff --git a/linux/mpd.nix b/linux/mpd.nix index 0a8ce907..89dd2c12 100644 --- a/linux/mpd.nix +++ b/linux/mpd.nix @@ -1,6 +1,6 @@ { - pkgs, - config, + # pkgs, + # config, ... }: { services.mpd = { diff --git a/overlays.nix b/overlays.nix index c548d18f..2f3c08c2 100644 --- a/overlays.nix +++ b/overlays.nix @@ -280,7 +280,4 @@ in [ url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"; sha256 = "sha256:143qm7bj651v2pwzq4sf5sp33g733inixf2b98sxf89ia0cabaqn"; })) - # rest-nvim-overlay - # inputs.rustaceanvim.overlays.default - # inputs.nixneovim.overlays.default ]