diff --git a/home-cli.nix b/home-cli.nix index 8d688f2..120b712 100644 --- a/home-cli.nix +++ b/home-cli.nix @@ -7,14 +7,73 @@ in home.stateVersion = "18.09"; home.packages = with pkgs; [ - ripgrep fd mosh w3m nnn hexyl wget httpie timg sox du-dust restic bitwarden-cli gnupg gpg-tui rage sd libqalculate glow spotify-tui spotifyd amfora duf pandoc pastel jq jo fx jc miller sc-im cacert weechat ddgr visidata magic-wormhole - nixfmt shellcheck vale tectonic zathura # lilypond-with-fonts - nodejs deno yarn nodePackages.typescript-language-server nodePackages.stylelint nodePackages.js-beautify nodePackages.expo-cli - ocaml dune_2 ocamlPackages.utop ocamlPackages.ocp-indent ocamlPackages.merlin - rustup go cmake racket-minimal + ripgrep + fd + mosh + w3m + nnn + hexyl + wget + httpie + timg + sox + du-dust + restic + bitwarden-cli + gnupg + gpg-tui + rage + sd + libqalculate + glow + spotify-tui + spotifyd + amfora + duf + pandoc + pastel + jq + jo + fx + jc + miller + sc-im + cacert + weechat + ddgr + visidata # magic-wormhole + nixfmt + shellcheck + vale + tectonic + zathura # lilypond-with-fonts + nodejs + deno + yarn + nodePackages.typescript-language-server + nodePackages.stylelint + nodePackages.js-beautify + nodePackages.expo-cli + ocaml + dune_2 + ocamlPackages.utop + ocamlPackages.ocp-indent + ocamlPackages.merlin + rustup + go + cmake + racket-minimal # ghc haskell-language-server hlint haskellPackages.hoogle lua53Packages.luarocks - ispell aspell aspellDicts.en aspellDicts.en-computers aspellDicts.en-science aspellDicts.fr aspellDicts.de aspellDicts.eo aspellDicts.es + ispell + aspell + aspellDicts.en + aspellDicts.en-computers + aspellDicts.en-science + aspellDicts.fr + aspellDicts.de + aspellDicts.eo + aspellDicts.es ]; home.sessionVariables = { @@ -61,7 +120,8 @@ in enableAliases = true; }; - programs.zoxide = { # z doc -> cd ~/Documents; zi -> interactive + programs.zoxide = { + # z doc -> cd ~/Documents; zi -> interactive enable = true; enableZshIntegration = true; enableFishIntegration = true; @@ -123,11 +183,11 @@ in defaultCommand = "fd --type file --color=always"; defaultOptions = [ "--height 40%" - "--border" - "--ansi" - "--color bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD" - "--color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96" - "--color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD" + "--border" + "--ansi" + "--color bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD" + "--color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96" + "--color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD" ]; fileWidgetCommand = "fd --type file --color=always"; @@ -249,18 +309,20 @@ in withNodeJs = true; withPython3 = true; withRuby = true; - extraLuaConfig = builtins.readFile ./vim.lua; + # extraLuaConfig = builtins.readFile ./vim.lua; }; + # xdg.configFile."nvim/lua/plugins/lazyvim-plugins.lua".source = ./lazyvim-plugins.lua; programs.bat = { enable = true; themes = { - Catppuccin-mocha = builtins.readFile (pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; - sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; - } + "/Catppuccin-mocha.tmTheme"); + Catppuccin-mocha = builtins.readFile (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "bat"; + rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1"; + sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; + } + "/Catppuccin-mocha.tmTheme"); }; config = { theme = "Catppuccin-mocha"; diff --git a/lazyvim-plugins.lua b/lazyvim-plugins.lua new file mode 100644 index 0000000..dd31ecf --- /dev/null +++ b/lazyvim-plugins.lua @@ -0,0 +1,32 @@ +return { + { "catppuccin/nvim", name = "catppuccin" }, + + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin", + }, + }, + + { + "nvim-orgmode/orgmode", + config = function() + require("orgmode").setup_ts_grammar() + + require("nvim-treesitter.configs").setup({ + highlight = { + enable = true, + additional_vim_regex_highlighting = { "org" }, -- Required for spellcheck, some LaTex highlights and code block highlights that do not have ts grammar + }, + ensure_installed = { "org" }, -- Or run :TSUpdate org + }) + + require("orgmode").setup({ + org_agenda_files = { "~/Sync/Notes/*" }, + org_default_notes_file = "~/Sync/Notes/Main.org", + }) + end, + }, + + { "dhruvasagar/vim-table-mode" }, +} diff --git a/lunar.lua b/lunar.lua deleted file mode 100644 index a44d89a..0000000 --- a/lunar.lua +++ /dev/null @@ -1,212 +0,0 @@ -lvim.log.level = "warn" -lvim.format_on_save = false -lvim.leader = "space" -vim.g.maplocalleader = ',' -lvim.colorscheme = "catppuccin" -lvim.transparent_window = true -vim.opt.conceallevel = 2 -- TODO: only for org files - -lvim.builtin.alpha.mode = 'startify' -lvim.builtin.notify.active = true -lvim.builtin.terminal.active = true -lvim.builtin.treesitter.highlight.enabled = true - -table.insert(lvim.builtin.cmp.sources, { name = "orgmode" }) - -lvim.plugins = { - { - "catppuccin/nvim", - require("catppuccin").setup { - vim.api.nvim_create_autocmd("OptionSet", { - pattern = "background", - callback = function() - vim.cmd("Catppuccin " .. (vim.v.option_new == "light" and "latte" or "mocha")) - end, - }) - }, - }, - { 'dhruvasagar/vim-table-mode' }, - { "nacro90/numb.nvim", event = "BufRead", config = function() require("numb").setup() end }, - { "npxbr/glow.nvim", ft = { "markdown" } }, - { "tpope/vim-repeat" }, - { "tpope/vim-surround" }, - { - "phaazon/hop.nvim", - event = "BufRead", - branch = "v2", - config = function() - require("hop").setup() - vim.api.nvim_set_keymap("n", "s", ":HopChar2", { silent = true }) - vim.api.nvim_set_keymap("n", "S", ":HopWord", { silent = true }) - end, - }, - { "folke/trouble.nvim", cmd = "TroubleToggle" }, - { "folke/todo-comments.nvim", event = "BufRead", config = function() require "todo-comments".setup() end }, - { "ray-x/lsp_signature.nvim", event = "BufRead", config = function() require "lsp_signature".setup() end }, - { "lukas-reineke/indent-blankline.nvim", event = "BufRead" }, - { "nvim-orgmode/orgmode", config = function() - -- vim.opt.conceallevel = 1 - - require('orgmode').setup { - org_agenda_files = {'~/Sync/Notes/*'}, - org_default_notes_file = '~/Sync/Notes/Main.org', - org_log_done = false, - } - end - }, - -- { "akinsho/org-bullets.nvim", - -- config = function() - -- require("org-bullets").setup { - -- symbols = { "◉", "○", "✸" } - -- } - -- end - -- }, - -- { - -- 'lukas-reineke/headlines.nvim', - -- config = function() - -- require('headlines').setup() - -- end, - -- }, - { - 'rmagatti/goto-preview', - config = function() - require('goto-preview').setup { - default_mappings = true, - } - end - }, - { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' }, - -- { - -- 'f-person/auto-dark-mode.nvim', - -- config = function() - -- local auto_dark_mode = require('auto-dark-mode') - -- auto_dark_mode.setup({ - -- set_dark_mode = function() - -- vim.api.nvim_set_option('background', 'dark') - -- -- vim.cmd('Catpuccin mocha') - -- end, - -- set_light_mode = function() - -- vim.api.nvim_set_option('background', 'light') - -- -- vim.cmd('colorscheme rose-pine') - -- end - -- }) - -- auto_dark_mode.init() - -- end - -- }, - { "jamessan/vim-gnupg" }, - { "simrat39/symbols-outline.nvim" }, - { 'alexghergh/nvim-tmux-navigation', config = function() - require'nvim-tmux-navigation'.setup { - disable_when_zoomed = true, -- defaults to false - keybindings = { - left = "", - down = "", - up = "", - right = "", - last_active = "", - next = "", - } - } - end - }, - { "AndrewRadev/splitjoin.vim" }, - { "azabiong/vim-highlighter" }, -- f- to highlight - { - "felipec/vim-sanegx", - event = "BufRead", - }, - { "uga-rosa/ccc.nvim" }, - { "anuvyklack/windows.nvim", - requires = { - "anuvyklack/middleclass", - "anuvyklack/animation.nvim" - }, - config = function() - vim.o.winwidth = 10 - vim.o.winminwidth = 10 - vim.o.equalalways = false - require('windows').setup() - vim.keymap.set('n', 'z', 'WindowsMaximize') - end - }, - { - 'martineausimon/nvim-lilypond-suite', - requires = { 'MunifTanjim/nui.nvim' } - }, - { - "lervag/vimtex", config = function() - vim.g.vimtex_compiler_method = "tectonic" - -- vim.g.vimtex_view_method = "zathura" - -- vim.g.vimtex_view_general_viewer = "zathura" - end - }, -} - - -require('orgmode').setup_ts_grammar() - -lvim.builtin.which_key.mappings["t"] = { - name = "Diagnostics", - t = { "TroubleToggle", "trouble" }, - w = { "TroubleToggle workspace_diagnostics", "workspace" }, - d = { "TroubleToggle document_diagnostics", "document" }, - q = { "TroubleToggle quickfix", "quickfix" }, - l = { "TroubleToggle loclist", "loclist" }, - r = { "TroubleToggle lsp_references", "references" }, -} -lvim.builtin.which_key.mappings["T"] = { - name = "Table Mode", - t = { ":TableModeToggle", "Toggle enable" }, - e = { ":TableEvalFormulaLine", "Eval formula line" }, - T = { ":TableModeRealign", "Realign" }, -} - -lvim.builtin.which_key.mappings["S"] = { "SymbolsOutline", "Symbols Outline" } - --- Org mode stuff - --- local parser_config = require "nvim-treesitter.parsers".get_parser_configs() --- parser_config.org = { --- install_info = { --- url = 'https://github.com/milisims/tree-sitter-org', --- revision = 'f110024d539e676f25b72b7c80b0fd43c34264ef', --- files = {'src/parser.c', 'src/scanner.cc'}, --- }, --- filetype = 'org', --- } - --- require'nvim-treesitter.configs'.setup { --- -- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting --- highlight = { --- enable = true, --- disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental) --- additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal) --- }, --- ensure_installed = {'org'}, -- Or run :TSUpdate org --- } - --- require('orgmode').setup({ --- org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'}, --- org_default_notes_file = '~/Dropbox/org/refile.org', --- }) - --- Prettier configuration -local formatters = require "lvim.lsp.null-ls.formatters" -formatters.setup { - { - exe = "prettier", - -- filetypes = { "javascriptreact", "javascript", "typescriptreact", "typescript", "json", "markdown", }, - }, -} - --- ESLint -local linters = require "lvim.lsp.null-ls.linters" -linters.setup { - { - exe = "eslint", - -- filetypes = { "javascriptreact", "javascript", "typescriptreact", "typescript", "vue", }, - }, - { - exe = "vale", - } -} diff --git a/vim.lua b/vim.lua deleted file mode 100644 index c0bf9d6..0000000 --- a/vim.lua +++ /dev/null @@ -1,400 +0,0 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ',' -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - -vim.opt.timeoutlen = 100 -vim.opt.number = true -vim.opt.mouse = 'a' -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.hlsearch = false -vim.opt.incsearch = true -vim.o.inccommand = "split" -vim.opt.expandtab = true -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.termguicolors = true -vim.opt.completeopt = "menu,menuone,noselect" -vim.opt.laststatus = 3 -- global status line -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undofile = true -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.scrolloff = 8 -vim.opt.updatetime = 50 - -vim.api.nvim_create_autocmd('FileType', { pattern = 'org', command = 'setlocal nowrap' }) -vim.api.nvim_create_autocmd('TextYankPost', { - pattern = '*', - callback = function() - vim.highlight.on_yank { higroup = 'IncSearch' } - end, -}) - -local ensure_packer = function() - local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' - if vim.fn.empty(vim.fn.glob(install_path)) > 0 then - vim.fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - vim.cmd [[packadd packer.nvim]] - return true - end - return false -end -local packer_bootstrap = ensure_packer() - -require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - use 'tpope/vim-surround' - use 'tpope/vim-repeat' - use 'felipec/vim-sanegx' - use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' } - use 'folke/neodev.nvim' - use 'jamessan/vim-gnupg' - use 'dhruvasagar/vim-table-mode' - use 'mfussenegger/nvim-dap' - use 'lukas-reineke/indent-blankline.nvim' - use 'LnL7/vim-nix' - use 'AndrewRadev/splitjoin.vim' - - use { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - requires = { 'nvim-lua/plenary.nvim' } - } - - use { - 'nvim-treesitter/nvim-treesitter', - run = function() require('nvim-treesitter.install').update({ with_sync = true }) end, - } - - use { 'nvim-orgmode/orgmode', config = function() - require('orgmode').setup_ts_grammar() - - require 'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - additional_vim_regex_highlighting = { 'org' }, -- Required for spellcheck, some LaTex highlights and code block highlights that do not have ts grammar - }, - ensure_installed = { 'org' }, -- Or run :TSUpdate org - } - - require('orgmode').setup({ - org_agenda_files = { '~/Sync/Notes/*' }, - org_default_notes_file = '~/Sync/Notes/Main.org', - }) - end } - - use { - "catppuccin/nvim", - as = "catppuccin", - config = function() - require("catppuccin").setup { - flavour = "mocha", -- mocha, macchiato, frappe, latte - transparent_background = true - } - vim.api.nvim_command "colorscheme catppuccin" - end - } - - use { - 'lewis6991/gitsigns.nvim', - config = function() - require('gitsigns').setup() - end - } - - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true }, - config = function() require('lualine').setup() end - } - - use { - "folke/which-key.nvim", - config = function() - require("which-key").setup({ - plugins = { - spelling = { - enabled = true - } - } - }) - end - } - - use { - 'akinsho/bufferline.nvim', - ag = "v3.*", - requires = 'kyazdani42/nvim-web-devicons', - config = function() - require("bufferline").setup() - end - } - - use 'nvim-tree/nvim-web-devicons' - - use { - "nvim-neo-tree/neo-tree.nvim", - branch = "v2.x", - requires = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - } - } - - use({ - "folke/noice.nvim", - event = "VimEnter", - config = function() - require("noice").setup() - require("notify").setup({ - background_colour = "#000000" - }) - end, - requires = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - } - }) - use { - 'VonHeikemen/lsp-zero.nvim', - requires = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, - { 'williamboman/mason.nvim' }, - { 'williamboman/mason-lspconfig.nvim' }, - - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, - { 'hrsh7th/cmp-buffer' }, - { 'hrsh7th/cmp-path' }, - { 'saadparwaiz1/cmp_luasnip' }, - { 'hrsh7th/cmp-nvim-lsp' }, - { 'hrsh7th/cmp-nvim-lua' }, - - -- Snippets - { 'L3MON4D3/LuaSnip' }, - { 'rafamadriz/friendly-snippets' }, - }, - config = function() - local lsp = require('lsp-zero') - lsp.preset('recommended') - lsp.setup() - end - } - - use { - 'numToStr/Comment.nvim', - config = function() - require('Comment').setup({ - toggler = { - line = 'cc', - block = 'cb', - }, - opleader = { - line = 'cc', - block = 'cb', - } - }) - end - } - - use { - 'JoosepAlviste/nvim-ts-context-commentstring', - config = function() - require 'nvim-treesitter.configs'.setup({ - context_commentstring = { - enable = true - } - }) - end - } - - use { - 'goolord/alpha-nvim', - requires = { 'kyazdani42/nvim-web-devicons' }, - config = function() - require 'alpha'.setup(require 'alpha.themes.startify'.config) - end - } - - use { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup {} - end - } - - use { - 'alexghergh/nvim-tmux-navigation', config = function() - require 'nvim-tmux-navigation'.setup { - keybindings = { - left = "", - down = "", - up = "", - right = "", - last_active = "", - next = "", - } - } - end - } - - use { - 'jose-elias-alvarez/null-ls.nvim', - config = function() - require("null-ls").setup({ - -- sources = { - -- require("null-ls").builtins.formatting.stylua, - -- require("null-ls").builtins.diagnostics.eslint, - -- require("null-ls").builtins.completion.spell, - -- }, - }) - end, - requires = { "nvim-lua/plenary.nvim" } - } - - use { - "akinsho/toggleterm.nvim", tag = '*', config = function() - require("toggleterm").setup({ - direction = 'float', - open_mapping = [[]] - }) - end - } - - use { - 'ggandor/leap.nvim', - config = function() - require('leap').add_default_mappings() - end - } - - use { - "folke/trouble.nvim", - requires = "kyazdani42/nvim-web-devicons", - config = function() - require("trouble").setup() - end - } - - use { - 'notjedi/nvim-rooter.lua', - config = function() - require 'nvim-rooter'.setup() - end - } - - use({ 'sindrets/winshift.nvim', - config = function() - require("winshift").setup() - end - }) - - use("mbbill/undotree"); - - use({ - "roobert/search-replace.nvim", - config = function() - require("search-replace").setup() - end - }) - - use({ - "chentoast/marks.nvim", - config = function() - require("marks").setup() - end - }) - - use({ - "utilyre/barbecue.nvim", - tag = "*", - requires = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("barbecue").setup() - end, - }) - - if packer_bootstrap then - require('packer').sync() - end -end) - -local wk = require("which-key") - -wk.register({ - [""] = { - a = { ":Alpha", "Alpha" }, - b = { - name = "Buffer", - d = { ":bdelete!", "Delete" }, - b = { "Telescope buffers", "Buffers" }, - t = { ":Neotree buffers", "Tree" }, - }, - c = "Comment", - f = { - name = "File", - f = { "Telescope find_files", "Files" }, - g = { "Telescope live_grep", "Grep" }, - r = { "Telescope oldfiles", "Recent" }, - t = { ":Neotree", "Tree" }, - d = { ":cd %:p:h", "Set Directory" }, - }, - g = { - name = "Git", - g = { ":2TermExec cmd='gitui'", "Gitui" }, - t = { ":Neotree git_status", "Tree" }, - b = { ":Gitsigns blame_line", "Blame" }, - d = { ":DiffviewOpen", "Diff" }, - h = { ":DiffviewFileHistory", "History" }, - }, - F = { ":lua vim.lsp.buf.format()", "Format" }, - J = { ":SplitjoinJoin", "Join" }, - t = { - name = "Table", - m = "Toggle Table Mode", - t = "Tableize", - r = { ":TableModeRealign", "Realign" }, - e = { ":TableEvalFormulaLine", "Evaluate" }, - }, - w = { - name = "Window", - s = { ":WinShift", "Shift" }, - }, - o = "Org", - p = { - name = "Packer", - s = { ":PackerSync", "Sync" }, - }, - S = { ":SplitjoinSplit", "Split" }, - T = { ":TroubleToggle", "Trouble" }, - u = { ":UndoTreeToggle", "UndoTree" }, - r = { - name = "Replace", - s = { "SearchReplaceSingleBufferSelections", "selction list" }, - o = { "SearchReplaceSingleBufferOpen", "open" }, - w = { "SearchReplaceSingleBufferCWord", "word" }, - W = { "SearchReplaceSingleBufferCWORD", "WORD" }, - e = { "SearchReplaceSingleBufferCExpr", "expr" }, - f = { "SearchReplaceSingleBufferCFile", "file" }, - b = { - name = "MultiBuffer", - s = { "SearchReplaceMultiBufferSelections", "selction list" }, - o = { "SearchReplaceMultiBufferOpen", "open" }, - w = { "SearchReplaceMultiBufferCWord", "word" }, - W = { "SearchReplaceMultiBufferCWORD", "WORD" }, - e = { "SearchReplaceMultiBufferCExpr", "expr" }, - f = { "SearchReplaceMultiBufferCFile", "file" }, - }, - }, - }, - [""] = { ":BufferLineCycleNext", "Next Tab" }, - [""] = { ":BufferLineCyclePrev", "Previous Tab" }, -})