diff --git a/dotfiles/neovim/.neoconf.json b/dotfiles/neovim/.neoconf.json new file mode 100644 index 0000000..9c389ef --- /dev/null +++ b/dotfiles/neovim/.neoconf.json @@ -0,0 +1,17 @@ +{ + "neoconf": { + "plugins": { + "sumneko_lua": { + "enabled": true + } + } + }, + "neodev": { + "library": { + "enabled": true, + "types": true, + "plugins": true, + "runtime": true + } + } +} diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index a95f202..3698f65 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -6,9 +6,8 @@ require("my.helpers.wrapMovement").setup() vim.opt.conceallevel = 0 vim.opt.wrap = true -vim.g.tex_conceal = "abdmg" vim.g.vimtex_imaps_enabled = 0 --- vim.g.vimtex_syntax_conceal = 1 +vim.g.vimtex_syntax_conceal_disable = 1 vim.keymap.set("n", "lg", function() if not pcall(function() diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua new file mode 100644 index 0000000..f5afbeb --- /dev/null +++ b/dotfiles/neovim/init.lua @@ -0,0 +1 @@ +require("my.init").setup() diff --git a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua index bf37704..726726b 100644 --- a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua +++ b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua @@ -1,14 +1,15 @@ local M = {} local function swap(key) - vim.keymap.set("nv", key, "g" .. key, { buffer = true }) - vim.keymap.set("nv", "g" .. key, key, { buffer = true }) + vim.keymap.set({ "n", "v" }, key, "g" .. key, { buffer = true }) + vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true }) end -- Same as swap, but the key is aprt of an arpeggio chord local function swapArpeggio(key) - vim.keymap.set("nv", "(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true }) - vim.keymap.set("nv", "g" .. key, key, { buffer = true }) + vim.keymap.set({ "n", "v" }, "(arpeggio-default:" .. key .. ")", "g" .. key, + { buffer = true }) + vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true }) end function M.setup() diff --git a/dotfiles/neovim/lua/my/paq.lua b/dotfiles/neovim/lua/my/paq.lua index e43e69d..61995a3 100644 --- a/dotfiles/neovim/lua/my/paq.lua +++ b/dotfiles/neovim/lua/my/paq.lua @@ -5,7 +5,9 @@ function M.setup() local themePackages = require("my.theme").deps local base = { "nvim-lua/plenary.nvim", -- async utility lib it seems? + "folke/neoconf.nvim", -- per project neovim configuration "neovim/nvim-lspconfig", -- configures lsps for me + "folke/neodev.nvim", -- lua support "windwp/nvim-autopairs", -- closes pairs for me (should look for a better one) "nvim-telescope/telescope.nvim", -- fuzzy search for say opening files "purescript-contrib/purescript-vim", -- purescript support diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua index 3fa867a..cdd7a6b 100644 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ b/dotfiles/neovim/lua/my/plugins/init.lua @@ -12,6 +12,8 @@ function M.setup() env.vscode.unless(function() env.firevim.unless(function() + require('my.plugins.neoconf').setup() + require("presence"):setup({}) require("my.plugins.nvim-tree").setup() require("my.plugins.lualine").setup() @@ -23,6 +25,7 @@ function M.setup() -- require("my.plugins.noice").setup() end) + require("my.plugins.neodev").setup() require("my.plugins.dashboard").setup() require("my.plugins.treesitter").setup() require("my.plugins.cmp").setup() @@ -30,7 +33,7 @@ function M.setup() require("my.plugins.lspconfig").setup() require("my.plugins.null-ls").setup() require("my.plugins.vimtex").setup() - require("my.plugins.lean").setup() + -- require("my.plugins.lean").setup() -- require("my.plugins.notify").setup() end) diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index 5a7c6ce..ad1fa8c 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -36,6 +36,7 @@ function M.on_attach(client, bufnr) end -- General server config +---@type lspconfig.options local servers = { tsserver = { on_attach = function(client, bufnr) @@ -45,29 +46,6 @@ local servers = { end }, dhall_lsp_server = {}, - sumneko_lua = { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - -- Setup your lua path - path = runtime_path - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { 'vim' } - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true) - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { enable = false } - } - }, - cmd = { "lua-language-server" } - }, purescriptls = { settings = { purescript = { @@ -84,22 +62,11 @@ local servers = { }, rnix = {}, cssls = {}, + jsonls = {}, rust_analyzer = {}, - -- texlab = { - -- build = { - -- executable = "tectonic", - -- args = { - -- "-X", - -- "compile", - -- "%f", - -- "--synctex", - -- "--keep-logs", - -- "--keep-intermediates" - -- } - -- } - -- }, - kotlin_language_server = {} - -- agda = {}, Haven't gotten this one to work yet + sumneko_lua = { + cmd = { "lua-language-server", "--logpath=/home/adrielus/.local/share/lua-language-server/log" } + } } M.capabilities = require('cmp_nvim_lsp').default_capabilities() diff --git a/dotfiles/neovim/lua/my/plugins/neoconf.lua b/dotfiles/neovim/lua/my/plugins/neoconf.lua new file mode 100644 index 0000000..5e32a04 --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/neoconf.lua @@ -0,0 +1,14 @@ +local M = {} + +function M.setup() + require("neoconf").setup({ + -- import existing settinsg from other plugins + import = { + vscode = true, -- local .vscode/settings.json + coc = false, -- global/local coc-settings.json + nlsp = false -- global/local nlsp-settings.nvim json settings + }, + }) +end + +return M diff --git a/dotfiles/neovim/lua/my/plugins/neodev.lua b/dotfiles/neovim/lua/my/plugins/neodev.lua new file mode 100644 index 0000000..55cdd2f --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/neodev.lua @@ -0,0 +1,7 @@ +local M = {} + +function M.setup() + require("neodev").setup() +end + +return M diff --git a/dotfiles/neovim/lua/my/plugins/treesitter.lua b/dotfiles/neovim/lua/my/plugins/treesitter.lua index 51a048e..4561a90 100644 --- a/dotfiles/neovim/lua/my/plugins/treesitter.lua +++ b/dotfiles/neovim/lua/my/plugins/treesitter.lua @@ -14,6 +14,7 @@ function M.setup() "fish", "html", "json", + "jsonc", "latex", "python", "rust", @@ -30,7 +31,7 @@ function M.setup() highlight = { enable = true, - disable = { "kotlin", "tex", "latex", "lean" }, + disable = { "kotlin", "tex", "latex" }, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). diff --git a/dotfiles/neovim/neoconf.json b/dotfiles/neovim/neoconf.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/dotfiles/neovim/neoconf.json @@ -0,0 +1 @@ +{} diff --git a/flake.lock b/flake.lock index dd0000f..95ea0b1 100644 --- a/flake.lock +++ b/flake.lock @@ -158,11 +158,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", "type": "github" }, "original": { @@ -203,11 +203,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -530,11 +530,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1667803793, - "narHash": "sha256-jKb4fbi8YcHoKpQB0HAO99CtcP4IFSRV07OT6kNFDGs=", + "lastModified": 1670899659, + "narHash": "sha256-HrEXh9qSkOb5Ke7IRoEs90lgLiUOTNWrfKJ9OLgk0uY=", "owner": "neovim", "repo": "neovim", - "rev": "e9c1cb71f8a4d6d7818dcb5f71ac78bee431309a", + "rev": "a6b05cb75d330dd995d3ad21ee08bb0a2cfcae74", "type": "github" }, "original": { @@ -553,11 +553,11 @@ ] }, "locked": { - "lastModified": 1667809192, - "narHash": "sha256-voNs0rYqJNqwtmm35rq35sQPFtXLgb1phGmBXG3x50o=", + "lastModified": 1670919334, + "narHash": "sha256-gLno1vCJ9zpSTeCLOP12Ja+dFu9yNTbS87ZC04H8Y9Q=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "488d9478d2b9a2481f6b0d04024a95c2135cef8f", + "rev": "b68451b57ce944623a6c16547bb88e3c349b6754", "type": "github" }, "original": { diff --git a/modules/applications/misc.nix b/modules/applications/misc.nix index f364181..6e9758d 100644 --- a/modules/applications/misc.nix +++ b/modules/applications/misc.nix @@ -71,6 +71,7 @@ # freesweep # minesweeper I can play w the keyboard. # multimc # lmms # music software + libsForQt5.dolphin # Nes emulators and stuff # zsnes diff --git a/modules/applications/neovim.nix b/modules/applications/neovim.nix index 606cd2d..c9d35a8 100644 --- a/modules/applications/neovim.nix +++ b/modules/applications/neovim.nix @@ -11,13 +11,11 @@ let extraPackages = with pkgs; [ # Language servers - # haskellPackages.agda-language-server # agda nodePackages.typescript-language-server # typescript easy-purescript-nix.purescript-language-server # purescript sumneko-lua-language-server # lua rnix-lsp # nix haskell-language-server # haskell - kotlin-language-server # kotlin tectonic # also latex something? texlab # latex # vscode-langservers-extracted # css and shit @@ -33,24 +31,20 @@ let wakatime # time tracking fd # file finder ripgrep # grep rewrite (I think?) - nodePackages.typescript # typescript language update-nix-fetchgit # useful for nix stuff tree-sitter # syntax highlighting libstdcxx5 # required by treesitter aparently + zathura # pdf reader + xdotool # for zathura reverse search or whatever it's called texlive.combined.scheme-full # latex stuff python38Packages.pygments # required for latex syntax highlighting ]; - myConfig = '' - vim.g.lualineTheme = "${theme.neovim.lualineTheme}" - vim.opt.runtimepath:append("${paths.dotfiles}/neovim") - vim.opt.runtimepath:append("${paths.dotfiles}/vscode-snippets") - require("my.init").setup() - ''; base = pkgs.neovim-nightly; # base = pkgs.neovim; + neovim = pkgs.symlinkJoin { inherit (base) name meta; @@ -61,15 +55,17 @@ let --prefix PATH : ${lib.makeBinPath extraPackages} ''; }; - nvim-treesitter = pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars); + + nixPlugins = ".local/share/nvim/site/pack/nix"; in { - home-manager.users.adrielus = + home-manager.users.adrielus = { config, ... }: + let simlink = config.lib.file.mkOutOfStoreSymlink; in { home.file.".local/share/nvim/site/pack/paqs/start/paq-nvim".source = paq; - # home.file.".local/share/nvim/site/pack/treesitter/start/nvim-treesitter".source = nvim-treesitter; - xdg.configFile."nvim/init.lua".text = myConfig; - xdg.configFile."nvim/lua/my/theme.lua".source = theme.neovim.theme; + home.file."${nixPlugins}/start/theming/lua/my/theme.lua".source = theme.neovim.theme; + home.file."${nixPlugins}/start/snippets".source = simlink "${paths.dotfiles}/vscode-snippets"; + home.file.".config/nvim".source = simlink "${paths.dotfiles}/neovim"; programs.neovim.enable = false; diff --git a/modules/overlays/tweakSources.nix b/modules/overlays/tweakSources.nix index 0288aed..d662ee6 100644 --- a/modules/overlays/tweakSources.nix +++ b/modules/overlays/tweakSources.nix @@ -3,16 +3,15 @@ with self; { discord = unstable.discord; vscode = unstable.vscode; tetrio-desktop = unstable.tetrio-desktop; + sumneko-lua-language-server = super.sumneko-lua-language-server.overrideAttrs (old: rec { + version = "unstable-2022-12-09"; + + src = fetchFromGitHub { + owner = "sumneko"; + repo = "lua-language-server"; + rev = "6d740a76ce170c396108e8bfc26b1286ac32c62f"; + sha256 = "0p9nyhzciw1i6r5crmrwx80ma21dxd3hl9sgvq6qc6qnmn67w8km"; + fetchSubmodules = true; + }; + }); } -# let version = "0.0.15"; -# in self -# { -# discord = super.discord.overrideAttrs (old: { -# inherit version; -# src = builtins.fetchurl { -# url = -# "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; -# sha256 = "0pn2qczim79hqk2limgh88fsn93sa8wvana74mpdk5n6x5afkvdd"; -# }; -# }); -# } diff --git a/modules/themes/catppuccin/nvim.lua b/modules/themes/catppuccin/nvim.lua index e40ff98..b3b4d6f 100644 --- a/modules/themes/catppuccin/nvim.lua +++ b/modules/themes/catppuccin/nvim.lua @@ -5,6 +5,7 @@ M.deps = { { "catppuccin/nvim", as = "catppuccin" } } function M.setup() local catppuccin = require("catppuccin") vim.g.catppuccin_flavour = os.getenv("CATPPUCCIN_FLAVOUR") + vim.g.lualineTheme = "catppuccin"; catppuccin.setup({ transparent_background = false, integrations = { nvimtree = true } })