diff --git a/config/nix/common/home.nix b/config/nix/common/home.nix index 2be4a49a..ee14e814 100644 --- a/config/nix/common/home.nix +++ b/config/nix/common/home.nix @@ -26,8 +26,9 @@ in { cmake fzf clang - # neovim-nightly - neovim + neovim-nightly + nil + # neovim (nerdfonts.override { fonts = [ "Hasklig" ]; }) mpv ] ++ (if device.isLinux then [ diff --git a/config/nix/linux/anyrun.nix b/config/nix/linux/anyrun.nix index b5408998..36562802 100644 --- a/config/nix/linux/anyrun.nix +++ b/config/nix/linux/anyrun.nix @@ -62,6 +62,10 @@ engines: [ Google, DuckDuckGo, + Custom ( + name: "GitHub", + url: "github.com/search?q={}" + ), Custom ( name: "Nix Packages", url: "search.nixos.org/packages?query={}" diff --git a/config/nix/linux/default.nix b/config/nix/linux/default.nix index 76a5b26f..f83ab17c 100644 --- a/config/nix/linux/default.nix +++ b/config/nix/linux/default.nix @@ -5,5 +5,6 @@ ../linux/gtk.nix ../linux/anyrun.nix ../linux/ironbar.nix + ../linux/foot.nix ]; } diff --git a/config/nix/linux/foot.nix b/config/nix/linux/foot.nix index c5d8f840..e096d268 100644 --- a/config/nix/linux/foot.nix +++ b/config/nix/linux/foot.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { - foot = { + programs.foot = { enable = pkgs.stdenv.isLinux; server.enable = true; settings = { diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 557f3c45..cebc2077 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -104,23 +104,3 @@ vim.g.copilot_no_tab_map = true require('keymaps') require('plugins') - --- require 'nvim-treesitter.configs'.setup { --- -- ensure_installed = "all", --- ensure_installed = { "c", "rust", "toml", "lua", "json", "python", "cmake", "make", "typescript", "bash", "cpp", --- "comment", "css", "fish", "http", "html", "vim", "yaml" }, --- highlight = { --- enable = true, -- false will disable the whole extension --- additional_vim_regex_highlighting = false, --- }, --- } --- require('nvim-treesitter.install').compilers = { "gcc-11", "clang" } --- require('nvim-treesitter.parsers').get_parser_configs().just = { --- install_info = { --- url = "https://github.com/IndianBoy42/tree-sitter-just", -- local path or git repo --- files = { "src/parser.c", "src/scanner.cc" }, --- branch = "main", --- use_makefile = true, -- this may be necessary on MacOS (try if you see compiler errors) --- }, --- maintainers = { "@IndianBoy42" }, --- } diff --git a/config/nvim/lua/keymaps.lua b/config/nvim/lua/keymaps.lua index 8a312dbb..1bb7e1c7 100644 --- a/config/nvim/lua/keymaps.lua +++ b/config/nvim/lua/keymaps.lua @@ -71,7 +71,6 @@ local normal_mode_maps = { -- { key = 'c', map = [[lua vim.lsp.buf.clear_references()]] }, { key = '"', map = [["+]] }, { key = 'F', map = [[lua vim.lsp.buf.format { async = true }]] }, - { key = 'T', map = [[lua require'lsp_extensions'.inlay_hints()]] }, { key = '%', map = [[vsplit]] }, { key = '"', map = [[split]] }, { key = '', map = [[:SymbolsOutline]] }, diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 3b75748e..99450de5 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -1,54 +1,19 @@ local lspconfig = require 'lspconfig' local lspstatus = require 'lsp-status' - +local lsp_zero = require'lsp-zero' local cmp_nvim_lsp = require 'cmp_nvim_lsp' + local capabilities = cmp_nvim_lsp.default_capabilities() --- if not vim.fn.filereadable('/etc/nix/nix.conf') then ( --- require("mason-lspconfig").setup_handlers { --- function(server_name) -- default handler (optional) --- lspconfig[server_name].setup { --- on_attach = function(client, bufnr) --- lspstatus.on_attach(client, bufnr) --- if client.server_capabilities.inlayHintProvider then --- vim.lsp.inlay_hint.enable(bufnr, true) --- end --- end, --- capabilities = capabilities, --- } --- end, --- ["rust_analyzer"] = function() --- vim.cmd([[autocmd BufEnter *.rs lua require("setup.rtools")]]) --- end, --- ["clangd"] = function() --- lspconfig.clangd.setup { --- capabilities = capabilities, --- cmd = { "clangd" }, --- filetypes = { "c", "cpp", "objc", "objcpp" }, --- root_dir = lspconfig.util.root_pattern("compile_commands.json", "compile_flags.txt", ".git"), --- single_file_support = true, --- } --- end, --- ["ast_grep"] = function() --- lspconfig.ast_grep.setup { --- cmd = { "sg", "lsp" }, --- filetypes = { "c", "cpp", "rust", "typescript" }, --- root_dir = lspconfig.util.root_pattern("compile_commands.json", "compile_flags.txt", ".git"), --- single_file_support = true, --- } --- end, --- ['nil_ls'] = function() --- lspconfig.nil_ls.setup { --- capabilities = capabilities, --- settings = { --- ['nil'] = { --- formatting = { --- command = { "nixfmt" }, --- } --- } --- } --- }; --- end --- } --- ) --- end +lsp_zero.extend_lspconfig() +lsp_zero.on_attach(function(client, bufnr) + lsp_zero.default_keymaps({buffer = bufnr}) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(bufnr, true) + end +end) + +local lua_opts = lsp_zero.nvim_lua_ls() +lspconfig.lua_ls.setup(lua_opts) +lspconfig.nil_ls.setup({}) +lspconfig.clangd.setup({}) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index a3395397..97e19ca5 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -64,35 +64,6 @@ return require('lazy').setup({ require('colorscheme') end }, - { - { - "nvim-neorg/neorg", - cmd = "Neorg", - ft = "norg", - build = ":Neorg sync-parsers", - opts = { - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.concealer"] = {}, -- Adds pretty icons to your documents - ["core.completion"] = { - config = { - engine = "nvim-cmp", - } - }, - ["core.dirman"] = { -- Manages Neorg workspaces - config = { - workspaces = { - notes = "~/Documents/norg", - }, - default_workspace = "general", - index = "index.norg" - }, - }, - }, - }, - dependencies = { "nvim-lua/plenary.nvim" }, - } - }, { 'folke/which-key.nvim', config = function() require("which-key").setup() end, event = "BufEnter" }, { 'nvim-telescope/telescope.nvim', @@ -100,44 +71,6 @@ return require('lazy').setup({ dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-ui-select.nvim', 'nvim-telescope/telescope-fzf-native.nvim' } }, - -- { - -- 'akinsho/git-conflict.nvim', - -- version = "*", - -- config = function() - -- require('git-conflict').setup() - -- end - -- }, - -- { - -- 'williamboman/mason.nvim', - -- cmd = { "Mason", "MasonInstall", "MasonUpdate", "MasonUninstall" }, - -- config = function() - -- require("mason").setup({ - -- ui = { - -- icons = { - -- package_installed = "✓", - -- package_pending = "➜", - -- package_uninstalled = "✗" - -- } - -- } - -- }) - -- end, - -- }, - -- { - -- "williamboman/mason-lspconfig.nvim", - -- config = function() - -- require("mason-lspconfig").setup({ - -- automatic_installation = true, - -- }) - -- -- if not vim.fn.filereadable("/etc/nix/nix.conf") then ( - -- -- require("mason-lspconfig").setup({ - -- -- ensure_installed = { "lua_ls" }, - -- -- automatic_installation = true, - -- -- }) - -- -- ) - -- -- end - -- end, - -- lazy = false, - -- }, { 'NTBBloodbath/galaxyline.nvim', branch = 'main', @@ -217,11 +150,12 @@ return require('lazy').setup({ { 'neovim/nvim-lspconfig', cmd = "LspStart", - ft = { "rust", "toml", "lua", "c", "cpp", "markdown", "sql", "python", "go" }, + ft = { "rust", "toml", "lua", "c", "cpp", "markdown", "sql", "python", "go", "nix" }, config = function() require("lsp") end }, + { 'VonHeikemen/lsp-zero.nvim', lazy = false }, { 'hrsh7th/cmp-nvim-lsp', lazy = false }, { 'hrsh7th/cmp-buffer', lazy = false }, { 'hrsh7th/cmp-path', lazy = false }, diff --git a/config/nvim/lua/setup/rtools.lua b/config/nvim/lua/setup/rtools.lua index 303a1055..6c01706c 100644 --- a/config/nvim/lua/setup/rtools.lua +++ b/config/nvim/lua/setup/rtools.lua @@ -1,15 +1,4 @@ --- Update this path --- local extension_path = vim.env.HOME .. '/.vscode/extensions/vadimcn.vscode-lldb-1.7.0' --- local codelldb_path = extension_path .. 'adapter/codelldb' --- local liblldb_path = extension_path .. 'lldb/lib/liblldb.dylib' --- local codelldb_path = '/Users/fs0c131y/.vscode-oss/extensions/vadimcn.vscode-lldb-1.8.1-universal/adapter/codelldb' --- local liblldb_path = '/Users/fs0c131y/.vscode-oss/extensions/vadimcn.vscode-lldb-1.8.1-universal/lldb/lib/liblldb.dylib' local lspstatus = require('lsp-status') --- local lsp_signature = require('lsp_signature') - - --- vim.cmd([[autocmd BufEnter,BufWinEnter,TabEnter *.rs :lua require('rust-tools.inlay_hints').set_inlay_hints()]]) --- require('rust-tools').setup(opts) local bufnr = vim.api.nvim_get_current_buf() -- vim.keymap.set( -- "n", @@ -49,6 +38,7 @@ vim.g.rustaceanvim = { -- tools = {}, -- LSP configuration server = { + capabilities = require'lsp_zero'.get_capabilities(), on_attach = function(client, bufnr) -- you can also put keymaps in here lspstatus.on_attach(client, bufnr)