forked from poz/niksos
feat(neovim): get rid of old nvim config
This commit is contained in:
parent
60b8309d5a
commit
9b85f90eb1
16 changed files with 1 additions and 387 deletions
|
@ -1,8 +1,8 @@
|
|||
_: {
|
||||
imports = [
|
||||
./neovim
|
||||
./btop.nix
|
||||
./helix.nix
|
||||
./neovim.nix
|
||||
./newsboat.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.shiftwidth=2
|
||||
vim.opt.tabstop=2
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.shiftwidth=2
|
||||
vim.opt.tabstop=2
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.shiftwidth=8
|
||||
vim.opt.tabstop=8
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.shiftwidth=4
|
||||
vim.opt.tabstop=4
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt.shiftwidth=2
|
||||
vim.opt.tabstop=2
|
|
@ -1,16 +0,0 @@
|
|||
require("global")
|
||||
require("keymap")
|
||||
require("plugins")
|
||||
require("opts")
|
||||
require("diagnostic")
|
||||
require("lsp")
|
||||
require("dap_conf")
|
||||
|
||||
-- shit I haven't been able to port yet
|
||||
vim.cmd [[
|
||||
if has('termguicolors')
|
||||
set termguicolors
|
||||
endif
|
||||
filetype plugin indent on
|
||||
autocmd VimEnter * hi Normal guibg=none
|
||||
]]
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"workspace.checkThirdParty": false
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
local dap = require("dap")
|
|
@ -1,12 +0,0 @@
|
|||
vim.diagnostic.config({
|
||||
-- text after the erroneous line
|
||||
virtual_text = true,
|
||||
signs = false,
|
||||
--float = { border = "single" },
|
||||
})
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts)
|
|
@ -1,15 +0,0 @@
|
|||
-- no triangles without it
|
||||
vim.g.airline_powerline_fonts = true
|
||||
vim.g.airline_theme="catppuccin"
|
||||
|
||||
-- TODO idk if these actually do anything
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
if vim.fn.exists("g:neovide") then
|
||||
vim.g.neovide_refresh_rate = 165
|
||||
vim.g.neovide_transparency = 0.85
|
||||
vim.g.neovide_cursor_vfx_mode = "railgun"
|
||||
end
|
||||
|
||||
vim.g.lichess_api_token = os.getenv("LICHESS_API_TOKEN")
|
|
@ -1,7 +0,0 @@
|
|||
--vim.keymap.set("n", "n", "h")
|
||||
--vim.keymap.set("n", "e", "j")
|
||||
--vim.keymap.set("n", "i", "k")
|
||||
--vim.keymap.set("n", "o", "l")
|
||||
--vim.keymap.set("n", "K", "N")
|
||||
--vim.keymap.set("n", "k", "n")
|
||||
--vim.keymap.set("n", "z", "b")
|
|
@ -1,97 +0,0 @@
|
|||
require("mason").setup()
|
||||
require("mason-lspconfig").setup {
|
||||
ensure_installed = {
|
||||
"rust_analyzer",
|
||||
"wgsl_analyzer",
|
||||
"tsserver",
|
||||
"svelte",
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"kotlin_language_server",
|
||||
"jedi_language_server",
|
||||
"jdtls",
|
||||
},
|
||||
}
|
||||
|
||||
local servers = {
|
||||
"tsserver",
|
||||
"svelte",
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"kotlin_language_server",
|
||||
"html",
|
||||
"cssls",
|
||||
"bashls",
|
||||
"cmake",
|
||||
"jedi_language_server",
|
||||
"jdtls",
|
||||
"wgsl_analyzer",
|
||||
"nil_ls",
|
||||
}
|
||||
|
||||
-- shit wouldn't stop whining about an unused local variable
|
||||
---@diagnostic disable-next-line: unused-local
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>r', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>a', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<C-f>', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
}
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
require("lspconfig")[server].setup(require("coq").lsp_ensure_capabilities({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}))
|
||||
end
|
||||
|
||||
require("flutter-tools").setup {
|
||||
lsp = require("coq").lsp_ensure_capabilities({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
virtual_text = true,
|
||||
}),
|
||||
}
|
||||
|
||||
local rt = require("rust-tools")
|
||||
rt.setup({
|
||||
tools = {
|
||||
inlay_hints = {
|
||||
auto = true,
|
||||
only_current_line = true,
|
||||
show_parameter_hints = true,
|
||||
}
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
-- https://github.com/simrat39/rust-tools.nvim/issues/300
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
inlayHints = { locationLinks = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
|
@ -1,39 +0,0 @@
|
|||
-- line numbers on the left
|
||||
vim.opt.number = true
|
||||
-- show number relative to current line
|
||||
vim.opt.relativenumber = true
|
||||
-- re-reads a file when it's changed
|
||||
vim.opt.autoread = true
|
||||
-- it scrolls the file when the cursor is x amount of lines from the edge
|
||||
vim.opt.so = 7
|
||||
-- show cmd even if not used
|
||||
vim.opt.cmdheight = 1
|
||||
-- ignores the case when searching
|
||||
vim.opt.ignorecase = true
|
||||
-- IDK do :help options and read the part about this I don't understand
|
||||
vim.opt.smartcase = true
|
||||
-- when you type a closing bracket it briefly jump to the opening one
|
||||
vim.opt.showmatch = true
|
||||
-- time in millis how long it wauts for another key in a sequence
|
||||
vim.opt.timeoutlen = 500
|
||||
-- yeah
|
||||
vim.opt.encoding = "utf8"
|
||||
-- IDK read the manual
|
||||
vim.opt.smarttab = true
|
||||
-- insert 4 spaces instead of tab
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
-- breaks line when too long
|
||||
vim.opt.linebreak = true
|
||||
-- indents but smart !
|
||||
vim.opt.smartindent = true
|
||||
-- saves the swap file to disk after this many millis
|
||||
vim.opt.updatetime = 300
|
||||
-- to keep the terminals from toggleterm on when hidden
|
||||
vim.opt.hidden = true
|
||||
vim.opt.background = "dark"
|
||||
-- for bufferline hover shit
|
||||
vim.opt.mousemoveevent = true
|
||||
-- true color
|
||||
--vim.opt.termguicolors = true
|
|
@ -1,186 +0,0 @@
|
|||
require "paq" {
|
||||
-- the paq:
|
||||
"savq/paq-nvim",
|
||||
-- tj lib
|
||||
"nvim-lua/plenary.nvim",
|
||||
-- TODO do I need this
|
||||
"cdelledonne/vim-cmake",
|
||||
-- TODO do I need this
|
||||
"tpope/vim-fugitive",
|
||||
-- the line on the bottom
|
||||
"vim-airline/vim-airline",
|
||||
"vim-airline/vim-airline-themes",
|
||||
-- switch between .c and .h
|
||||
"nacitar/a.vim",
|
||||
-- sitting on the tree
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
-- fast as FUCK completion
|
||||
"ms-jpq/coq_nvim",
|
||||
"ms-jpq/coq.artifacts",
|
||||
-- file explorer
|
||||
{ "ms-jpq/chadtree", run = "python3 -m chadtree deps" },
|
||||
-- better term
|
||||
"akinsho/toggleterm.nvim",
|
||||
-- hide secrets and shit
|
||||
"laytan/cloak.nvim",
|
||||
-- some cool icons for other plugins
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
-- shows git changes at the start of the line
|
||||
"lewis6991/gitsigns.nvim",
|
||||
-- lsp manager
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
-- the one and only
|
||||
"neovim/nvim-lspconfig",
|
||||
-- flutter takes up too much space man
|
||||
"akinsho/flutter-tools.nvim",
|
||||
-- <3
|
||||
"simrat39/rust-tools.nvim",
|
||||
-- s to jump to what you see on the screen
|
||||
"ggandor/leap.nvim",
|
||||
-- color picker
|
||||
"uga-rosa/ccc.nvim",
|
||||
-- some fun shit
|
||||
"Eandrju/cellular-automaton.nvim",
|
||||
-- progress thingy for lsp loading
|
||||
{ "j-hui/fidget.nvim", branch = "legacy" },
|
||||
-- better lsp for nvim config
|
||||
"folke/neodev.nvim",
|
||||
-- zen like me kernel
|
||||
"folke/zen-mode.nvim",
|
||||
-- dims inactive code
|
||||
"folke/twilight.nvim",
|
||||
-- the scope:
|
||||
"nvim-telescope/telescope.nvim",
|
||||
-- the comment:
|
||||
"numToStr/Comment.nvim",
|
||||
-- needed for cheat sheet
|
||||
"RishabhRD/popfix",
|
||||
-- cheat sheet
|
||||
"RishabhRD/nvim-cheat.sh",
|
||||
-- rust :3
|
||||
"Saecki/crates.nvim",
|
||||
-- chess :3
|
||||
"luk400/vim-lichess",
|
||||
--
|
||||
"mfussenegger/nvim-dap",
|
||||
"lrangell/theme-cycler.nvim",
|
||||
{ "catppuccin/nvim", as="catppuccin" },
|
||||
}
|
||||
|
||||
vim.filetype.add({extension = {wgsl = "wgsl"}})
|
||||
|
||||
require("nvim-treesitter.configs").setup {
|
||||
highlight = { enable = true, },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "gzn",
|
||||
node_decremental = "gzm",
|
||||
scope_incremental = "gzb",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.wo.foldmethod = "expr"
|
||||
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.o.foldlevelstart = 99
|
||||
|
||||
require("toggleterm").setup {
|
||||
size = 10,
|
||||
open_mapping = [[<C-\>]],
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
auto_scroll = true,
|
||||
direction = "float",
|
||||
}
|
||||
|
||||
-- cock
|
||||
vim.g.coq_settings = {
|
||||
auto_start = "shut-up",
|
||||
display = {
|
||||
pum = {
|
||||
fast_close = true,
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
always = false,
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<space>v", vim.cmd.CHADopen)
|
||||
|
||||
require("neodev").setup()
|
||||
|
||||
require("cloak").setup({
|
||||
cloak_character = "•",
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<C-c>", require("cloak").toggle)
|
||||
|
||||
require("gitsigns").setup {
|
||||
signcolumn = true,
|
||||
numhl = true,
|
||||
word_diff = true,
|
||||
current_line_blame = true,
|
||||
}
|
||||
|
||||
require("leap").add_default_mappings()
|
||||
|
||||
require("fidget").setup()
|
||||
|
||||
require("ccc").setup({
|
||||
highlighter = {
|
||||
auto_enable = true
|
||||
}
|
||||
})
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts)
|
||||
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
|
||||
vim.keymap.set("n", "<leader>fh", builtin.help_tags, opts)
|
||||
|
||||
require("Comment").setup()
|
||||
|
||||
local chadtree_settings = {
|
||||
keymap = {
|
||||
tertiary = { "<leader>t", "<middlemouse>" }
|
||||
}
|
||||
}
|
||||
vim.api.nvim_set_var("chadtree_settings", chadtree_settings)
|
||||
|
||||
local crates = require("crates")
|
||||
|
||||
crates.setup {
|
||||
src = {
|
||||
coq = {
|
||||
enabled = true,
|
||||
name = "crates.nvim",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>ct', crates.toggle, opts)
|
||||
vim.keymap.set('n', '<leader>cr', crates.reload, opts)
|
||||
|
||||
vim.keymap.set('n', '<leader>cv', crates.show_versions_popup, opts)
|
||||
vim.keymap.set('n', '<leader>cf', crates.show_features_popup, opts)
|
||||
vim.keymap.set('n', '<leader>cd', crates.show_dependencies_popup, opts)
|
||||
|
||||
vim.keymap.set('n', '<leader>cu', crates.update_crate, opts)
|
||||
vim.keymap.set('v', '<leader>cu', crates.update_crates, opts)
|
||||
vim.keymap.set('n', '<leader>ca', crates.update_all_crates, opts)
|
||||
vim.keymap.set('n', '<leader>cU', crates.upgrade_crate, opts)
|
||||
vim.keymap.set('v', '<leader>cU', crates.upgrade_crates, opts)
|
||||
vim.keymap.set('n', '<leader>cA', crates.upgrade_all_crates, opts)
|
||||
|
||||
vim.keymap.set('n', '<leader>cH', crates.open_homepage, opts)
|
||||
vim.keymap.set('n', '<leader>cR', crates.open_repository, opts)
|
||||
vim.keymap.set('n', '<leader>cD', crates.open_documentation, opts)
|
||||
vim.keymap.set('n', '<leader>cC', crates.open_crates_io, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>t", require("themeCycler").open_lazy)
|
Loading…
Reference in a new issue