From bb2057f5d5e0624cea0c764fa7d4b244045ba64a Mon Sep 17 00:00:00 2001 From: ISnortPennies Date: Fri, 30 Sep 2022 14:48:40 -0400 Subject: [PATCH] a bunch of neovim configuration --- home-manager/neovim/config/init.lua | 3 +++ home-manager/neovim/config/lspconfig.lua | 27 +++--------------------- home-manager/neovim/default.nix | 5 ++--- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/home-manager/neovim/config/init.lua b/home-manager/neovim/config/init.lua index 0fddb1b..929ec3f 100644 --- a/home-manager/neovim/config/init.lua +++ b/home-manager/neovim/config/init.lua @@ -33,6 +33,9 @@ vim.g.loaded_netrwPlugin = 1 require("nvim-tree").setup { open_on_setup = true, sort_by = "case_sensitive", + view = { + adaptive_size = true, + }, actions = { open_file = { quit_on_open = true, diff --git a/home-manager/neovim/config/lspconfig.lua b/home-manager/neovim/config/lspconfig.lua index 411f3fd..09ef86c 100644 --- a/home-manager/neovim/config/lspconfig.lua +++ b/home-manager/neovim/config/lspconfig.lua @@ -1,24 +1,3 @@ -local lspc = require'lspconfig' - -local buf_map = function(bufnr, mode, lhs, rhs, opts) - vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { - silent = true, - }) -end - -lspc.tsserver.setup({ - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false - local ts_utils = require("nvim-lsp-ts-utils") - - ts_utils.setup({}) - ts_utils.setup_client(client) - - buf_map(bufnr, "n", "gs", ":TSLspOrganize") - buf_map(bufnr, "n", "gi", ":TSLspRenameFile") - buf_map(bufnr, "n", "go", ":TSLspImportAll") - - on_attach(client, bufnr) - end, -}) +local lspc = require("lspconfig") +lspc.rust_analyzer.setup{} +lspc.clangd.setup{} diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index 6277a8c..2c4c5e1 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -11,10 +11,8 @@ vim-moonfly = pkgs.vimUtils.buildVimPlugin { }; }; in - - - { + home.packages = with pkgs; [rustc cargo rust-analyzer clang-tools]; programs.neovim = { enable = true; viAlias = true; @@ -68,3 +66,4 @@ in }; } +