[feat] Fix nvim config
This commit is contained in:
@@ -26,8 +26,9 @@ in {
|
|||||||
cmake
|
cmake
|
||||||
fzf
|
fzf
|
||||||
clang
|
clang
|
||||||
# neovim-nightly
|
neovim-nightly
|
||||||
neovim
|
nil
|
||||||
|
# neovim
|
||||||
(nerdfonts.override { fonts = [ "Hasklig" ]; })
|
(nerdfonts.override { fonts = [ "Hasklig" ]; })
|
||||||
mpv
|
mpv
|
||||||
] ++ (if device.isLinux then [
|
] ++ (if device.isLinux then [
|
||||||
|
|||||||
@@ -62,6 +62,10 @@
|
|||||||
engines: [
|
engines: [
|
||||||
Google,
|
Google,
|
||||||
DuckDuckGo,
|
DuckDuckGo,
|
||||||
|
Custom (
|
||||||
|
name: "GitHub",
|
||||||
|
url: "github.com/search?q={}"
|
||||||
|
),
|
||||||
Custom (
|
Custom (
|
||||||
name: "Nix Packages",
|
name: "Nix Packages",
|
||||||
url: "search.nixos.org/packages?query={}"
|
url: "search.nixos.org/packages?query={}"
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
../linux/gtk.nix
|
../linux/gtk.nix
|
||||||
../linux/anyrun.nix
|
../linux/anyrun.nix
|
||||||
../linux/ironbar.nix
|
../linux/ironbar.nix
|
||||||
|
../linux/foot.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
foot = {
|
programs.foot = {
|
||||||
enable = pkgs.stdenv.isLinux;
|
enable = pkgs.stdenv.isLinux;
|
||||||
server.enable = true;
|
server.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -104,23 +104,3 @@ vim.g.copilot_no_tab_map = true
|
|||||||
|
|
||||||
require('keymaps')
|
require('keymaps')
|
||||||
require('plugins')
|
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" },
|
|
||||||
-- }
|
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ local normal_mode_maps = {
|
|||||||
-- { key = '<leader>c', map = [[<cmd>lua vim.lsp.buf.clear_references()<cr>]] },
|
-- { key = '<leader>c', map = [[<cmd>lua vim.lsp.buf.clear_references()<cr>]] },
|
||||||
{ key = '<leader>"', map = [["+]] },
|
{ key = '<leader>"', map = [["+]] },
|
||||||
{ key = 'F', map = [[<cmd>lua vim.lsp.buf.format { async = true }<cr>]] },
|
{ 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>vsplit<cr>]] },
|
||||||
{ key = '<C-W>"', map = [[<cmd>split<cr>]] },
|
{ key = '<C-W>"', map = [[<cmd>split<cr>]] },
|
||||||
{ key = '<C-l>', map = [[<cmd>:SymbolsOutline<cr>]] },
|
{ key = '<C-l>', map = [[<cmd>:SymbolsOutline<cr>]] },
|
||||||
|
|||||||
@@ -1,54 +1,19 @@
|
|||||||
local lspconfig = require 'lspconfig'
|
local lspconfig = require 'lspconfig'
|
||||||
local lspstatus = require 'lsp-status'
|
local lspstatus = require 'lsp-status'
|
||||||
|
local lsp_zero = require'lsp-zero'
|
||||||
local cmp_nvim_lsp = require 'cmp_nvim_lsp'
|
local cmp_nvim_lsp = require 'cmp_nvim_lsp'
|
||||||
|
|
||||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
-- if not vim.fn.filereadable('/etc/nix/nix.conf') then (
|
lsp_zero.extend_lspconfig()
|
||||||
-- require("mason-lspconfig").setup_handlers {
|
lsp_zero.on_attach(function(client, bufnr)
|
||||||
-- function(server_name) -- default handler (optional)
|
lsp_zero.default_keymaps({buffer = bufnr})
|
||||||
-- lspconfig[server_name].setup {
|
if client.server_capabilities.inlayHintProvider then
|
||||||
-- on_attach = function(client, bufnr)
|
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||||
-- lspstatus.on_attach(client, bufnr)
|
end
|
||||||
-- if client.server_capabilities.inlayHintProvider then
|
end)
|
||||||
-- vim.lsp.inlay_hint.enable(bufnr, true)
|
|
||||||
-- end
|
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||||
-- end,
|
lspconfig.lua_ls.setup(lua_opts)
|
||||||
-- capabilities = capabilities,
|
lspconfig.nil_ls.setup({})
|
||||||
-- }
|
lspconfig.clangd.setup({})
|
||||||
-- 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
|
|
||||||
|
|||||||
@@ -64,35 +64,6 @@ return require('lazy').setup({
|
|||||||
require('colorscheme')
|
require('colorscheme')
|
||||||
end
|
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" },
|
{ 'folke/which-key.nvim', config = function() require("which-key").setup() end, event = "BufEnter" },
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
@@ -100,44 +71,6 @@ return require('lazy').setup({
|
|||||||
dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-ui-select.nvim',
|
dependencies = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-ui-select.nvim',
|
||||||
'nvim-telescope/telescope-fzf-native.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',
|
'NTBBloodbath/galaxyline.nvim',
|
||||||
branch = 'main',
|
branch = 'main',
|
||||||
@@ -217,11 +150,12 @@ return require('lazy').setup({
|
|||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
cmd = "LspStart",
|
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()
|
config = function()
|
||||||
require("lsp")
|
require("lsp")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
{ 'VonHeikemen/lsp-zero.nvim', lazy = false },
|
||||||
{ 'hrsh7th/cmp-nvim-lsp', lazy = false },
|
{ 'hrsh7th/cmp-nvim-lsp', lazy = false },
|
||||||
{ 'hrsh7th/cmp-buffer', lazy = false },
|
{ 'hrsh7th/cmp-buffer', lazy = false },
|
||||||
{ 'hrsh7th/cmp-path', lazy = false },
|
{ 'hrsh7th/cmp-path', lazy = false },
|
||||||
|
|||||||
@@ -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 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()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
-- vim.keymap.set(
|
-- vim.keymap.set(
|
||||||
-- "n",
|
-- "n",
|
||||||
@@ -49,6 +38,7 @@ vim.g.rustaceanvim = {
|
|||||||
-- tools = {},
|
-- tools = {},
|
||||||
-- LSP configuration
|
-- LSP configuration
|
||||||
server = {
|
server = {
|
||||||
|
capabilities = require'lsp_zero'.get_capabilities(),
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
-- you can also put keymaps in here
|
-- you can also put keymaps in here
|
||||||
lspstatus.on_attach(client, bufnr)
|
lspstatus.on_attach(client, bufnr)
|
||||||
|
|||||||
Reference in New Issue
Block a user