neovim config
This commit is contained in:
parent
6343061ca1
commit
ecb5ae8f16
@ -1,3 +0,0 @@
|
|||||||
# Example_config
|
|
||||||
|
|
||||||
This can be used as an example custom config for NvChad, this branch is a minimal one. Do check the feature_full branch if you need all the ease in your config.
|
|
@ -1,20 +0,0 @@
|
|||||||
---@type ChadrcConfig
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
-- Path to overriding theme and highlights files
|
|
||||||
local highlights = require "custom.highlights"
|
|
||||||
|
|
||||||
M.ui = {
|
|
||||||
theme = "onedark",
|
|
||||||
theme_toggle = { "onedark", "one_light" },
|
|
||||||
|
|
||||||
hl_override = highlights.override,
|
|
||||||
hl_add = highlights.add,
|
|
||||||
}
|
|
||||||
|
|
||||||
M.plugins = "custom.plugins"
|
|
||||||
|
|
||||||
-- check core.mappings for table structure
|
|
||||||
M.mappings = require "custom.mappings"
|
|
||||||
|
|
||||||
return M
|
|
@ -1,17 +0,0 @@
|
|||||||
local on_attach = require("plugins.configs.lspconfig").on_attach
|
|
||||||
local capabilities = require("plugins.configs.lspconfig").capabilities
|
|
||||||
|
|
||||||
local lspconfig = require "lspconfig"
|
|
||||||
|
|
||||||
-- if you just want default config for the servers then put them in a table
|
|
||||||
local servers = { "html", "cssls", "tsserver", "clangd", "rnix" }
|
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
--
|
|
||||||
-- lspconfig.pyright.setup { blabla}
|
|
@ -1,27 +0,0 @@
|
|||||||
local present, null_ls = pcall(require, "null-ls")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local b = null_ls.builtins
|
|
||||||
|
|
||||||
local sources = {
|
|
||||||
|
|
||||||
-- webdev stuff
|
|
||||||
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
|
|
||||||
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
|
|
||||||
|
|
||||||
-- Lua
|
|
||||||
b.formatting.stylua,
|
|
||||||
|
|
||||||
-- cpp
|
|
||||||
b.formatting.clang_format,
|
|
||||||
|
|
||||||
b.formatting.alejandra
|
|
||||||
}
|
|
||||||
|
|
||||||
null_ls.setup {
|
|
||||||
debug = true,
|
|
||||||
sources = sources,
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
M.treesitter = {
|
|
||||||
ensure_installed = {
|
|
||||||
"vim",
|
|
||||||
"lua",
|
|
||||||
"html",
|
|
||||||
"css",
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"tsx",
|
|
||||||
"c",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"nix",
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
-- disable = {
|
|
||||||
-- "python"
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
M.mason = {
|
|
||||||
ensure_installed = {
|
|
||||||
-- lua stuff
|
|
||||||
"lua-language-server",
|
|
||||||
"stylua",
|
|
||||||
|
|
||||||
-- web dev stuff
|
|
||||||
"css-lsp",
|
|
||||||
"html-lsp",
|
|
||||||
"typescript-language-server",
|
|
||||||
"deno",
|
|
||||||
"prettier",
|
|
||||||
|
|
||||||
-- c/cpp stuff
|
|
||||||
"clangd",
|
|
||||||
"clang-format",
|
|
||||||
|
|
||||||
-- NixOS stuff
|
|
||||||
"rnix-lsp"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
M.ui = {
|
|
||||||
transparency = true,
|
|
||||||
theme = "catppuccin"
|
|
||||||
}
|
|
||||||
|
|
||||||
-- git support in nvimtree
|
|
||||||
M.nvimtree = {
|
|
||||||
git = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
renderer = {
|
|
||||||
highlight_git = true,
|
|
||||||
icons = {
|
|
||||||
show = {
|
|
||||||
git = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
@ -1,19 +0,0 @@
|
|||||||
-- To find any highlight groups: "<cmd> Telescope highlights"
|
|
||||||
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
|
|
||||||
-- base30 variable names can also be used as colors
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
---@type Base46HLGroupsList
|
|
||||||
M.override = {
|
|
||||||
Comment = {
|
|
||||||
italic = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
---@type HLTable
|
|
||||||
M.add = {
|
|
||||||
NvimTreeOpenedFolderName = { fg = "green", bold = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
@ -1,7 +0,0 @@
|
|||||||
-- local autocmd = vim.api.nvim_create_autocmd
|
|
||||||
|
|
||||||
-- Auto resize panes when resizing nvim window
|
|
||||||
-- autocmd("VimResized", {
|
|
||||||
-- pattern = "*",
|
|
||||||
-- command = "tabdo wincmd =",
|
|
||||||
-- })
|
|
@ -1,12 +0,0 @@
|
|||||||
---@type MappingsTable
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
M.general = {
|
|
||||||
n = {
|
|
||||||
[";"] = { ":", "enter command mode", opts = { nowait = true } },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- more keybinds!
|
|
||||||
|
|
||||||
return M
|
|
@ -1,65 +0,0 @@
|
|||||||
local overrides = require("custom.configs.overrides")
|
|
||||||
|
|
||||||
---@type NvPluginSpec[]
|
|
||||||
local plugins = {
|
|
||||||
|
|
||||||
-- Override plugin definition options
|
|
||||||
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
-- format & linting
|
|
||||||
{
|
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
|
||||||
config = function()
|
|
||||||
require "custom.configs.null-ls"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require "plugins.configs.lspconfig"
|
|
||||||
require "custom.configs.lspconfig"
|
|
||||||
end, -- Override to setup mason-lspconfig
|
|
||||||
},
|
|
||||||
|
|
||||||
-- override plugin configs
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
opts = overrides.mason
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
opts = overrides.treesitter,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
opts = overrides.nvimtree,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Install a plugin
|
|
||||||
{
|
|
||||||
"max397574/better-escape.nvim",
|
|
||||||
event = "InsertEnter",
|
|
||||||
config = function()
|
|
||||||
require("better_escape").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- To make a plugin not be loaded
|
|
||||||
-- {
|
|
||||||
-- "NvChad/nvim-colorizer.lua",
|
|
||||||
-- enabled = false
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- All NvChad plugins are lazy-loaded by default
|
|
||||||
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
|
|
||||||
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
|
|
||||||
-- {
|
|
||||||
-- "mg979/vim-visual-multi",
|
|
||||||
-- lazy = false,
|
|
||||||
-- }
|
|
||||||
}
|
|
||||||
|
|
||||||
return plugins
|
|
12
cfg/nvim/init.lua
Normal file
12
cfg/nvim/init.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
vim.wo.number = true
|
||||||
|
|
||||||
|
local nmap = function(keys, cmd) vim.keymap.set('n', keys, cmd, {noremap = true, silent = true}) end
|
||||||
|
|
||||||
|
nmap('<Tab>','<cmd>BufferNext<cr>')
|
||||||
|
nmap('<S-Tab>','<cmd>BufferPrevious<cr>')
|
||||||
|
|
||||||
|
require("nvim-tree").setup()
|
||||||
|
nmap('<C-t>', '<cmd>NvimTreeToggle<cr>')
|
||||||
|
|
||||||
|
require("catppuccin").setup({flavour = "mocha", transparent_background = true})
|
||||||
|
vim.cmd.colorscheme "catppuccin"
|
@ -57,7 +57,6 @@
|
|||||||
libgccjit
|
libgccjit
|
||||||
libmtp
|
libmtp
|
||||||
lolcat
|
lolcat
|
||||||
lua
|
|
||||||
mako
|
mako
|
||||||
mlocate
|
mlocate
|
||||||
mupdf
|
mupdf
|
||||||
|
13
home.nix
13
home.nix
@ -41,6 +41,8 @@
|
|||||||
viAlias = true;
|
viAlias = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
alejandra
|
alejandra
|
||||||
|
lua
|
||||||
|
luaformatter
|
||||||
lua-language-server
|
lua-language-server
|
||||||
libclang
|
libclang
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
@ -51,11 +53,10 @@
|
|||||||
nvim-tree-lua
|
nvim-tree-lua
|
||||||
telescope-nvim
|
telescope-nvim
|
||||||
catppuccin-nvim
|
catppuccin-nvim
|
||||||
|
nvim-web-devicons
|
||||||
|
barbar-nvim
|
||||||
];
|
];
|
||||||
extraLuaConfig = ''
|
extraLuaConfig = lib.fileContents ./cfg/nvim/init.lua;
|
||||||
require("nvim-tree").setup()
|
|
||||||
vim.cmd.colorscheme "catppuccin"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
zsh = {
|
zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -90,10 +91,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"nvim/lua/custom" = {
|
|
||||||
source = ./cfg/nvim/custom;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
"sway/config" = {
|
"sway/config" = {
|
||||||
source = ./cfg/sway/config;
|
source = ./cfg/sway/config;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user