[feat] Fix nvim config

This commit is contained in:
uttarayan21
2024-02-20 02:50:09 +05:30
parent 67726f3120
commit 9983668d75
9 changed files with 26 additions and 152 deletions

View File

@@ -26,8 +26,9 @@ in {
cmake
fzf
clang
# neovim-nightly
neovim
neovim-nightly
nil
# neovim
(nerdfonts.override { fonts = [ "Hasklig" ]; })
mpv
] ++ (if device.isLinux then [

View File

@@ -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={}"

View File

@@ -5,5 +5,6 @@
../linux/gtk.nix
../linux/anyrun.nix
../linux/ironbar.nix
../linux/foot.nix
];
}

View File

@@ -1,5 +1,5 @@
{ pkgs, ... }: {
foot = {
programs.foot = {
enable = pkgs.stdenv.isLinux;
server.enable = true;
settings = {

View File

@@ -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" },
-- }

View File

@@ -71,7 +71,6 @@ local normal_mode_maps = {
-- { key = '<leader>c', map = [[<cmd>lua vim.lsp.buf.clear_references()<cr>]] },
{ key = '<leader>"', map = [["+]] },
{ key = 'F', map = [[<cmd>lua vim.lsp.buf.format { async = true }<cr>]] },
{ key = 'T', map = [[<cmd>lua require'lsp_extensions'.inlay_hints()<cr>]] },
{ key = '<C-W>%', map = [[<cmd>vsplit<cr>]] },
{ key = '<C-W>"', map = [[<cmd>split<cr>]] },
{ key = '<C-l>', map = [[<cmd>:SymbolsOutline<cr>]] },

View File

@@ -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({})

View File

@@ -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 },

View File

@@ -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)