make config more lightweight

This commit is contained in:
davidon-top 2023-09-19 18:57:21 +02:00
parent c0ea7b465b
commit 9d922f8de5
16 changed files with 79 additions and 515 deletions

View file

@ -21,8 +21,6 @@ vim.api.nvim_create_user_command("OP", function ()
local selection = action_state.get_selected_entry()
selection = selection[1]
vim.cmd("cd $HOME/projects/" .. selection)
vim.cmd("Alpha")
vim.cmd("BWipeout other")
end)
return true
end
@ -46,8 +44,6 @@ vim.api.nvim_create_user_command("OCC", function ()
local selection = action_state.get_selected_entry()
selection = selection[1]
vim.cmd("cd $HOME/projects/cc/" .. selection)
vim.cmd("Alpha")
vim.cmd("BWipeout other")
end)
return true
end
@ -71,8 +67,6 @@ vim.api.nvim_create_user_command("OD", function ()
local selection = action_state.get_selected_entry()
selection = selection[1]
vim.cmd("cd " .. selection)
vim.cmd("Alpha")
vim.cmd("BWipeout other")
end)
return true
end
@ -81,12 +75,6 @@ end, {})
vim.api.nvim_create_user_command("Config", function ()
vim.cmd("cd $HOME/.config/nvim")
vim.cmd("Alpha")
vim.cmd("BWipeout other")
end, {})
vim.api.nvim_create_user_command("O", function ()
require("oil").open_float(vim.fn.getcwd())
end, {})
vim.api.nvim_create_user_command("RetabFile", function ()

View file

@ -10,11 +10,9 @@ local keys = {
b = {"<cmd>NeoTreeFloatToggle buffers<CR>", "Buffers"},
c = {"<cmd>NeoTreeClose<CR>" , "Close"},
u = {vim.cmd.UndotreeToggle, "UndoTree"},
o = {function () require("oil").open_float(vim.fn.getcwd()) end, "Oil"},
},
c = {
name = "LSP",
S = {vim.cmd.AerialToggle, "Symbol sidebar"},
w = {function () vim.lsp.buf.workspace_symbol("") end, "workspace symbol"},
d = {function () vim.diagnostic.open_float() end, "diagnostic"},
a = {function () vim.lsp.buf.code_action() end, "code actions"},
@ -23,15 +21,7 @@ local keys = {
h = {function () vim.lsp.buf.hover() end, "Hover"},
t = {function () vim.lsp.buf.type_definition() end,"Type Definition"},
s = {"<cmd>Navbuddy<cr>", "Navbuddy"},
-- s = {require("telescope.builtin").lsp_document_symbols, "Document Symbols"},
g = {
name = "Goto Preview",
d = {function () require('goto-preview').goto_preview_definition() end, "Definition"},
r = {function () require('goto-preview').goto_preview_references() end, "References"},
t = {function () require("goto-preview").goto_preview_type_definitions() end, "Type"},
i = {function () require("goto-preview").goto_preview_implementation() end, "Implementation"},
c = {function () require("goto-preview").close_all_win() end, "Close"},
},
S = {require("telescope.builtin").lsp_document_symbols, "Document Symbols"},
l = {
name = "LSP",
k = {"<cmd>LspStop<cr>", "Stop"},
@ -48,12 +38,6 @@ local keys = {
p = {"<cmd>Copilot suggestion prev<cr>", "Previous"},
}
},
q = {
name = "Nvim",
q = {"<cmd>q<cr>", "Quit"},
W = {"<cmd>wq<cr>", "Save and Quit"},
w = {"<cmd>w<cr>", "Save"},
},
b = {
name = "Buffer",
h = {vim.cmd.bprevious, "Previous"},
@ -73,14 +57,13 @@ local keys = {
b = {require("telescope.builtin").buffers, "buffers"},
h = {require("telescope.builtin").help_tags, "help tags"},
s = {function () require("telescope.builtin").grep_string({ search = vim.fn.input("Grep > ")}); end, "grep search through files"},
p = {"<cmd>Telescope projects<cr>", "Projects"},
},
s = {
name = "Settings",
c = {function ()
vim.opt.scrolloff = 100
end, "Always center cursor"},
x = {function ()
C = {function ()
vim.opt.scrolloff = 8
end, "Disable Cursor center"},
f = {function ()
@ -144,6 +127,7 @@ vim.keymap.set("i", "<C-h>", function () vim.lsp.buf.hover() end, {})
-- term
vim.keymap.set("n", "<C-\\>", vim.cmd.ToggleTerm)
vim.keymap.set("t", "<C-\\>", vim.cmd.ToggleTerm)
vim.keymap.set("v", "<C-\\>", vim.cmd.ToggleTerm)
-- center
vim.keymap.set("n", "<C-d>", "<C-d>zz")
@ -178,4 +162,6 @@ vim.keymap.set('i', '<C-Space>f?', require('telescope.builtin').oldfiles, { desc
for i = 9, 1, -1 do
vim.keymap.set("n", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
vim.keymap.set("i", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
vim.keymap.set("v", "<M-" .. i .. ">", function() require("harpoon.ui").nav_file(i) end, {desc = ""})
end

View file

@ -8,11 +8,6 @@ return {
"folke/neodev.nvim",
},
},
{
"jinzhongjia/LspUI.nvim",
config = true,
branch = "legacy",
},
{
"VidocqH/lsp-lens.nvim",
config = true,
@ -34,7 +29,6 @@ return {
event = "BufRead",
config = function() require"lsp_signature".on_attach() end,
},
{'stevearc/aerial.nvim', config = true},
{
"hrsh7th/nvim-cmp",
dependencies = {
@ -47,10 +41,6 @@ return {
"rafamadriz/friendly-snippets"
},
},
{
"roobert/tailwindcss-colorizer-cmp.nvim",
opts = {color_square_width = 2},
},
-- syntax highlighting
{
@ -90,83 +80,35 @@ return {
"nvim-telescope/telescope-dap.nvim",
-- git
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim"
},
config=true,
},
"tpope/vim-fugitive",
"tpope/vim-rhubarb",
"lewis6991/gitsigns.nvim",
"lvimuser/lsp-inlayhints.nvim",
"s1n7ax/nvim-window-picker",
"echasnovski/mini.nvim",
{
'stevearc/oil.nvim',
opts = {
columns = {
"icon",
"permissions",
"size",
},
-- keymap = {
-- ["<C-c>"] = "actions.close",
-- },
view_options = {
show_hidden = true,
},
}
},
"ThePrimeagen/vim-be-good",
{'kazhala/close-buffers.nvim', config = true},
-- {
-- "VonHeikemen/fine-cmdline.nvim",
-- dependencies = {{"MunifTanjim/nui.nvim"}},
-- config = function()
-- require("fine-cmdline").setup({
-- cmdline = {
-- prompt = ">",
-- }
-- })
-- vim.api.nvim_set_keymap('n', ':', '<cmd>FineCmdline<CR>', {noremap = true})
-- end
-- },
'stevearc/dressing.nvim',
{'stevearc/dressing.nvim', opts = {}},
{
'stevearc/overseer.nvim',
'anuvyklack/pretty-fold.nvim',
opts = {
strategy = "toggleterm",
keep_indentation = true,
fill_char = '',
sections = {
left = {
'', function() return string.rep('*', vim.v.foldlevel) end, ' ━┫', 'content', ''
},
right = {
'', 'number_of_folded_lines', ': ', 'percentage', ' ┣━━',
}
}
}
},
"itchyny/screensaver.vim",
'anuvyklack/pretty-fold.nvim',
'eandrju/cellular-automaton.nvim',
"ahmedkhalf/project.nvim",
"dhruvasagar/vim-table-mode",
"editorconfig/editorconfig-vim",
"andweeb/presence.nvim",
"nacro90/numb.nvim",
{"ellisonleao/glow.nvim", config = true, cmd = "Glow"},
{"nacro90/numb.nvim", opts = {}},
{"kylechui/nvim-surround", opts={}},
{
"phaazon/hop.nvim",
event = "BufRead",
opts = {}
},
{
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
filters = {
dotfiles = true,
},
}
},
{
"ThePrimeagen/harpoon"
},
@ -182,19 +124,6 @@ return {
["border"] = "rounded",
},
},
{
"natecraddock/workspaces.nvim",
opts = {
auto_open = true,
hooks = {
add = {},
remove = {},
rename = {},
open_pre = {},
open = {},
},
}
},
"lambdalisue/suda.vim",
"tpope/vim-sleuth",
"mbbill/undotree",
@ -216,24 +145,12 @@ return {
filetypes = {'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', 'rescript', 'xml', 'php', 'markdown', 'astro', 'glimmer', 'handlebars', 'hbs', "rust" },
},
},
{
'bennypowers/nvim-regexplainer',
dependencies = {
'nvim-treesitter/nvim-treesitter',
'MunifTanjim/nui.nvim',
}
},
{
"rcarriga/nvim-notify",
config = function ()
vim.notify = require("notify")
end
},
'nmac427/guess-indent.nvim',
'mrjones2014/smart-splits.nvim',
"goolord/alpha-nvim",
"preservim/nerdtree",
"luukvbaal/nnn.nvim",
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
@ -243,7 +160,6 @@ return {
"MunifTanjim/nui.nvim",
},
},
"jistr/vim-nerdtree-tabs",
{
"kevinhwang91/nvim-bqf",
event = { "BufRead", "BufNew" },
@ -269,13 +185,11 @@ return {
}
},
"nvim-tree/nvim-web-devicons",
"ap/vim-css-color",
{
"lukas-reineke/indent-blankline.nvim",
opts = {
char = '',
show_trailing_blankline_indent = false,
filetype_exclude = {"dashboard"},
show_end_of_line = true,
show_current_context = true,
show_current_context_start = true,
@ -340,11 +254,6 @@ return {
window = {border="rounded",},
}
},
'rmagatti/goto-preview',
{
"felipec/vim-sanegx",
event = "BufRead",
},
{
"gelguy/wilder.nvim",
config = function()
@ -353,7 +262,6 @@ return {
vim.cmd('call wilder#set_option("renderer", wilder#popupmenu_renderer(wilder#popupmenu_border_theme({"highlighter": wilder#basic_highlighter(), "min_width": "100%", "min_height": "50%", "reverse": 0, "highlights": {"border": "Normal",},"border": "rounded"})))')
end,
},
{
"zbirenbaum/copilot.lua",
opts = {
@ -363,20 +271,25 @@ return {
},
},
-- language mixing also OTTER
{"tpope/vim-dadbod"},
{
"jmbuhr/otter.nvim",
"kristijanhusak/vim-dadbod-ui",
dependencies = {
'hrsh7th/nvim-cmp',
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter'
{ 'tpope/vim-dadbod', lazy = true },
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true },
},
cmd = {
'DBUI',
'DBUIToggle',
'DBUIAddConnection',
'DBUIFindBuffer',
},
init = function()
vim.g.db_ui_use_nerd_fonts = 1
end
},
-- lenguage specific
-- nim
"alaviss/nim.nvim",
-- csv
'cameron-wags/rainbow_csv.nvim',
@ -416,93 +329,18 @@ return {
"mfussenegger/nvim-jdtls",
-- c && c++ && cmake
{ "igankevich/mesonic",
config = function()
vim.cmd[[
let b:meson_command = 'meson'
let b:meson_ninja_command = 'ninja'
autocmd FileType c call ConsiderMesonForLinting()
function ConsiderMesonForLinting()
if filereadable('meson.build')
let g:syntastic_c_checkers = ['meson']
endif
endfunction
]]
end
},
"cdelledonne/vim-cmake",
-- web
"evanleck/vim-svelte",
"posva/vim-vue",
-- yuck
"elkowar/yuck.vim",
-- f#
"adelarsq/neofsharp.vim",
{
"ionide/Ionide-vim",
config = function ()
vim.cmd [[
let g:fsharp#backend = "nvim"
]]
end
},
"aurum77/dotnet.nvim",
-- mojo
{
"czheo/mojo.vim",
init = function()
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = { "*.🔥" },
callback = function()
if vim.bo.filetype ~= "mojo" then
vim.bo.filetype = "mojo"
end
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "mojo",
callback = function()
local modular = vim.env.MODULAR_HOME
local lsp_cmd = modular .. "/pkg/packages.modular.com_mojo/bin/mojo-lsp-server"
vim.bo.expandtab = true
vim.bo.shiftwidth = 4
vim.bo.softtabstop = 4
vim.lsp.start({
name = "mojo",
cmd = { lsp_cmd },
})
end,
})
end,
},
-- themes
"xiyaowong/transparent.nvim",
"sainnhe/gruvbox-material",
"shaunsingh/nord.nvim",
"projekt0n/github-nvim-theme",
"EdenEast/nightfox.nvim",
"Everblush/nvim",
"olimorris/onedarkpro.nvim",
"rmehri01/onenord.nvim",
"luisiacc/gruvbox-baby",
"tiagovla/tokyodark.nvim",
"cpea2506/one_monokai.nvim",
"yazeed1s/minimal.nvim",
"Mofiqul/adwaita.nvim",
"kvrohit/mellow.nvim",
"yazeed1s/oh-lucy.nvim",
"marko-cerovac/material.nvim",
"sainnhe/sonokai",
"rebelot/kanagawa.nvim",
{
@ -538,7 +376,6 @@ return {
-- }
}
}
vim.cmd("colorscheme catppuccin")
end
},
}

View file

@ -18,7 +18,7 @@ require("lazy").setup("config.packages", {
defaults = {
lazy = false
},
-- install = {
-- colorscheme = { "catppuccin" },
-- }
})
install = {
colorscheme = { "carbonfox" },
}
})

View file

@ -31,7 +31,7 @@ vim.o.smartcase = true
-- colors
vim.opt.termguicolors = true
vim.cmd("colorscheme catppuccin")
vim.cmd("colorscheme carbonfox")
vim.opt.cursorline = true
vim.opt.cursorcolumn = true
@ -52,6 +52,3 @@ vim.o.mouse = "a"
vim.opt.showmode = false
vim.o.completeopt = "menuone,noselect"
-- idfk pls fix nim
vim.opt.path = vim.opt.path + "/home/d/.nimble/bin/**"