more nvim work
This commit is contained in:
parent
b5b91a7a91
commit
3f55ab5502
4 changed files with 73 additions and 15 deletions
.config/nvim
|
@ -1,10 +1,28 @@
|
||||||
require('plugins')
|
require('plugins')
|
||||||
require('keybinds')
|
require('keybinds')
|
||||||
require('theme')
|
|
||||||
|
|
||||||
require('bufferline').setup()
|
require('bufferline').setup() -- TODO: only open when more than one buffer is open, remove exit button
|
||||||
require('mason').setup()
|
require('mason').setup({
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓",
|
||||||
|
package_pending = "➜",
|
||||||
|
package_uninstalled = "✗"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = { "sumneko_lua", "bashls", "clangd" },
|
||||||
|
automatic_installation = false
|
||||||
|
})
|
||||||
|
require('tokyonight').setup({
|
||||||
|
transparent = true,
|
||||||
|
terminal_colors = true,
|
||||||
|
dim_inactive = true,
|
||||||
|
lualine_bold = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd[[colorscheme tokyonight]]
|
||||||
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
|
vim.opt.undodir = vim.fn.stdpath "cache" .. "/undo"
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
vim.opt.conceallevel = 0
|
vim.opt.conceallevel = 0
|
||||||
|
@ -49,3 +67,17 @@ for _, entry in ipairs(require('autocmds')) do
|
||||||
end
|
end
|
||||||
vim.api.nvim_create_autocmd(event, opts)
|
vim.api.nvim_create_autocmd(event, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- automatically set up language servers
|
||||||
|
-- local lspconfig = require('lspconfig')
|
||||||
|
-- local mason_registry = require('mason-registry')
|
||||||
|
-- lspconfig.util.default_config = vim.tbl_extend(
|
||||||
|
-- "force",
|
||||||
|
-- lspconfig.util.default_config,
|
||||||
|
-- {
|
||||||
|
-- on_attach = on_attach
|
||||||
|
-- }
|
||||||
|
-- )
|
||||||
|
-- for _, server in ipairs(require('mason-registry').get_installed_packages()) do
|
||||||
|
-- lspconfig[server.name].setup {}
|
||||||
|
-- end
|
||||||
|
|
|
@ -2,11 +2,20 @@ local M = {}
|
||||||
vim.g.mapleader = "space"
|
vim.g.mapleader = "space"
|
||||||
|
|
||||||
function M.wk_setup()
|
function M.wk_setup()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.kb_setup()
|
function M.kb_setup(maps)
|
||||||
|
local options = { noremap = true }
|
||||||
|
for mode, binds in ipairs(maps) do
|
||||||
|
for _, bind in ipairs(binds) do
|
||||||
|
local key = bind[1]
|
||||||
|
local cmd = bind[2]
|
||||||
|
if entry[3] then
|
||||||
|
opts = rim.tbl_extend("force", options, bind[3])
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, key, cmd, opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
return function()
|
|
||||||
require("tokyonight").setup({
|
|
||||||
transparent = true,
|
|
||||||
terminal_colors = true,
|
|
||||||
dim_inactive = true,
|
|
||||||
lualine_bold = true,
|
|
||||||
})
|
|
||||||
vim.cmd[[colorscheme tokyonight]]
|
|
||||||
end
|
|
26
.config/nvim/lua/util.lua
Normal file
26
.config/nvim/lua/util.lua
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
local M = {}
|
||||||
|
vim.g.mapleader = "space"
|
||||||
|
|
||||||
|
local function map(maps)
|
||||||
|
local options = { noremap = true }
|
||||||
|
for mode, binds in ipairs(maps) do
|
||||||
|
for _, bind in ipairs(binds) do
|
||||||
|
local key = bind[1]
|
||||||
|
local cmd = bind[2]
|
||||||
|
if entry[3] then
|
||||||
|
opts = rim.tbl_extend("force", options, bind[3])
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, key, cmd, opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.wk_setup()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.kb_setup()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Add table
Add a link
Reference in a new issue