+7
README.md
+7
README.md
···
1
+
# bpavuk's Dotfiles!
2
+
3
+
To install these dotfiles, clone this repository (preferably into
4
+
`~/.dotfiles`), install GNU Stow, then type `stow <program-name>`. For Neovim,
5
+
that would be `stow nvim`. Make sure to read relevant READMEs inside every
6
+
dotfile directory to get a list of dependencies you need to install to make
7
+
this work!
+6
nvim/.config/nvim/.stylua.toml
+6
nvim/.config/nvim/.stylua.toml
+11
nvim/.config/nvim/after/ftplugin/markdown.lua
+11
nvim/.config/nvim/after/ftplugin/markdown.lua
···
1
+
local bufnr = vim.api.nvim_get_current_buf()
2
+
vim.keymap.set(
3
+
"n",
4
+
"<leader>md",
5
+
function()
6
+
vim.cmd.RenderMarkdown('toggle') -- supports rust-analyzer's grouping
7
+
-- or vim.lsp.buf.codeAction() if you don't want grouping.
8
+
end,
9
+
{ silent = true, buffer = bufnr, desc = "Render Markdown" }
10
+
)
11
+
require('cmp').setup.buffer { completion = { autocomplete = false } }
+26
nvim/.config/nvim/after/ftplugin/rust.lua
+26
nvim/.config/nvim/after/ftplugin/rust.lua
···
1
+
local bufnr = vim.api.nvim_get_current_buf()
2
+
vim.keymap.set(
3
+
"n",
4
+
"<leader>a",
5
+
function()
6
+
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
7
+
-- or vim.lsp.buf.codeAction() if you don't want grouping.
8
+
end,
9
+
{ silent = true, buffer = bufnr, desc = "Code action" }
10
+
)
11
+
vim.keymap.set(
12
+
"n",
13
+
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
14
+
function()
15
+
vim.cmd.RustLsp({'hover', 'actions'})
16
+
end,
17
+
{ silent = true, buffer = bufnr }
18
+
)
19
+
vim.keymap.set(
20
+
"n",
21
+
"<leader>R",
22
+
function()
23
+
vim.cmd.RustLsp({'run'})
24
+
end,
25
+
{ buffer = bufnr, desc = "Run" }
26
+
)
+37
nvim/.config/nvim/init.lua
+37
nvim/.config/nvim/init.lua
···
1
+
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
2
+
vim.g.mapleader = " "
3
+
4
+
-- bootstrap lazy and all plugins
5
+
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
6
+
7
+
if not vim.uv.fs_stat(lazypath) then
8
+
local repo = "https://github.com/folke/lazy.nvim.git"
9
+
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
10
+
end
11
+
12
+
vim.opt.rtp:prepend(lazypath)
13
+
14
+
local lazy_config = require "configs.lazy"
15
+
16
+
-- load plugins
17
+
require("lazy").setup({
18
+
{
19
+
"NvChad/NvChad",
20
+
lazy = false,
21
+
branch = "v2.5",
22
+
import = "nvchad.plugins",
23
+
},
24
+
25
+
{ import = "plugins" },
26
+
}, lazy_config)
27
+
28
+
-- load theme
29
+
dofile(vim.g.base46_cache .. "defaults")
30
+
dofile(vim.g.base46_cache .. "statusline")
31
+
32
+
require "options"
33
+
require "nvchad.autocmds"
34
+
35
+
vim.schedule(function()
36
+
require "mappings"
37
+
end)
+37
nvim/.config/nvim/lazy-lock.json
+37
nvim/.config/nvim/lazy-lock.json
···
1
+
{
2
+
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
3
+
"NvChad": { "branch": "v2.5", "commit": "6f25b2739684389ca69ea8229386c098c566c408" },
4
+
"Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" },
5
+
"base46": { "branch": "v3.0", "commit": "80358ecdb5779b199130ed03031c34c0c2bca3fc" },
6
+
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
7
+
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
8
+
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
9
+
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
10
+
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
11
+
"conform.nvim": { "branch": "master", "commit": "b1a75324ddf96b7bb84963a297b1ed334db087c0" },
12
+
"crates.nvim": { "branch": "main", "commit": "fd2bbca7aa588f24ffc3517831934b4c4a9588e9" },
13
+
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
14
+
"gitsigns.nvim": { "branch": "main", "commit": "ee28ba3e70ecea811b8f6d7b51d81976e94b121c" },
15
+
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
16
+
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
17
+
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
18
+
"menu": { "branch": "main", "commit": "8adb036ec34c679050913864cbc98cc64eb91f6c" },
19
+
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
20
+
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
21
+
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
22
+
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
23
+
"nvim-lspconfig": { "branch": "master", "commit": "3e873195f501b1e02d9fd7e5af5cbe74fc2f98c1" },
24
+
"nvim-tree.lua": { "branch": "master", "commit": "582ae48c9e43d2bcd55dfcc8e2e7a1f29065d924" },
25
+
"nvim-treesitter": { "branch": "master", "commit": "523a9e148919f58eb5a013f76787e57696e00c93" },
26
+
"nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
27
+
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
28
+
"render-markdown.nvim": { "branch": "main", "commit": "0ed141a60ca4befcaf923b21c36f6f2971d61b9e" },
29
+
"rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" },
30
+
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
31
+
"tmux.nvim": { "branch": "main", "commit": "2c1c3be0ef287073cef963f2aefa31a15c8b9cd8" },
32
+
"ui": { "branch": "v3.0", "commit": "4466c87073c811c22b14215ba8a0cfc7d1b8b688" },
33
+
"vim-slint": { "branch": "main", "commit": "9badce3860297562bb5e80ba1666628f9e0ac632" },
34
+
"volt": { "branch": "main", "commit": "c45d5f48da8e802e608b5c6da471ca4d84276dfb" },
35
+
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
36
+
"zola.nvim": { "branch": "main", "commit": "0319c188e443ecae90819cf013d46ff9bf387def" }
37
+
}
+18
nvim/.config/nvim/lua/chadrc.lua
+18
nvim/.config/nvim/lua/chadrc.lua
···
1
+
-- This file needs to have same structure as nvconfig.lua
2
+
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
3
+
-- Please read that file to know all available options :(
4
+
5
+
---@type ChadrcConfig
6
+
local M = {}
7
+
8
+
M.base46 = {
9
+
theme = "mountain",
10
+
transparency = true,
11
+
12
+
-- hl_override = {
13
+
-- Comment = { italic = true },
14
+
-- ["@comment"] = { italic = true },
15
+
-- },
16
+
}
17
+
18
+
return M
+15
nvim/.config/nvim/lua/configs/conform.lua
+15
nvim/.config/nvim/lua/configs/conform.lua
···
1
+
local options = {
2
+
formatters_by_ft = {
3
+
lua = { "stylua" },
4
+
css = { "prettier" },
5
+
html = { "prettier" },
6
+
},
7
+
8
+
-- format_on_save = {
9
+
-- -- These options will be passed to conform.format()
10
+
-- timeout_ms = 500,
11
+
-- lsp_fallback = true,
12
+
-- },
13
+
}
14
+
15
+
return options
+47
nvim/.config/nvim/lua/configs/lazy.lua
+47
nvim/.config/nvim/lua/configs/lazy.lua
···
1
+
return {
2
+
defaults = { lazy = true },
3
+
install = { colorscheme = { "nvchad" } },
4
+
5
+
ui = {
6
+
icons = {
7
+
ft = "",
8
+
lazy = " ",
9
+
loaded = "",
10
+
not_loaded = "",
11
+
},
12
+
},
13
+
14
+
performance = {
15
+
rtp = {
16
+
disabled_plugins = {
17
+
"2html_plugin",
18
+
"tohtml",
19
+
"getscript",
20
+
"getscriptPlugin",
21
+
"gzip",
22
+
"logipat",
23
+
"netrw",
24
+
"netrwPlugin",
25
+
"netrwSettings",
26
+
"netrwFileHandlers",
27
+
"matchit",
28
+
"tar",
29
+
"tarPlugin",
30
+
"rrhelper",
31
+
"spellfile_plugin",
32
+
"vimball",
33
+
"vimballPlugin",
34
+
"zip",
35
+
"zipPlugin",
36
+
"tutor",
37
+
"rplugin",
38
+
"syntax",
39
+
"synmenu",
40
+
"optwin",
41
+
"compiler",
42
+
"bugreport",
43
+
"ftplugin",
44
+
},
45
+
},
46
+
},
47
+
}
+42
nvim/.config/nvim/lua/configs/lspconfig.lua
+42
nvim/.config/nvim/lua/configs/lspconfig.lua
···
1
+
local configs = require "nvchad.configs.lspconfig"
2
+
3
+
local servers = {
4
+
html = {
5
+
filetypes = { "html", "htmldjango", "superhtml" }
6
+
},
7
+
cssls = {},
8
+
somesass_ls = {
9
+
root_dir = function(...)
10
+
return require("lspconfig.util").root_pattern ".git"(...)
11
+
end,
12
+
init_options = {
13
+
workspace = root_dir,
14
+
},
15
+
},
16
+
bashls = {},
17
+
clangd = {},
18
+
19
+
slint_lsp = {},
20
+
21
+
pyright = {
22
+
settings = {
23
+
python = {
24
+
analysis = {
25
+
autoSearchPaths = true,
26
+
typeCheckingMode = "basic",
27
+
},
28
+
},
29
+
},
30
+
},
31
+
32
+
asm_lsp = {},
33
+
rnix = {},
34
+
}
35
+
36
+
for name, opts in pairs(servers) do
37
+
opts.on_init = configs.on_init
38
+
opts.on_attach = configs.on_attach
39
+
opts.capabilities = configs.capabilities
40
+
41
+
require("lspconfig")[name].setup(opts)
42
+
end
+21
nvim/.config/nvim/lua/mappings.lua
+21
nvim/.config/nvim/lua/mappings.lua
···
1
+
require "nvchad.mappings"
2
+
3
+
-- add yours here
4
+
5
+
local map = vim.keymap.set
6
+
local tmux = require("tmux")
7
+
8
+
map("n", ";", ":", { desc = "CMD enter command mode" })
9
+
map("i", "jk", "<ESC>")
10
+
map("n", "<leader>rs", function()
11
+
vim.lsp.buf.rename()
12
+
end, { desc = "Rename the symbol at cursor" })
13
+
14
+
15
+
-- tmux navigation
16
+
map("n", "<C-h>", function() tmux.move_left() end)
17
+
map("n", "<C-j>", function() tmux.move_bottom() end)
18
+
map("n", "<C-k>", function() tmux.move_top() end)
19
+
map("n", "<C-l>", function() tmux.move_right() end)
20
+
21
+
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
+6
nvim/.config/nvim/lua/options.lua
+6
nvim/.config/nvim/lua/options.lua
+59
nvim/.config/nvim/lua/plugins/init.lua
+59
nvim/.config/nvim/lua/plugins/init.lua
···
1
+
return {
2
+
{
3
+
"stevearc/conform.nvim",
4
+
-- event = 'BufWritePre', -- uncomment for format on save
5
+
opts = require "configs.conform",
6
+
},
7
+
8
+
-- These are some examples, uncomment them if you want to see them work!
9
+
{
10
+
"neovim/nvim-lspconfig",
11
+
config = function()
12
+
require "configs.lspconfig"
13
+
end,
14
+
},
15
+
16
+
{
17
+
"MeanderingProgrammer/render-markdown.nvim",
18
+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
19
+
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins
20
+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
21
+
---@module 'render-markdown'
22
+
---@type render.md.UserConfig
23
+
opts = {},
24
+
ft = { "markdown", "quarto" },
25
+
},
26
+
27
+
{
28
+
"aserowy/tmux.nvim",
29
+
config = function()
30
+
return require("tmux").setup()
31
+
end,
32
+
lazy = false,
33
+
},
34
+
35
+
{
36
+
"yorik1984/zola.nvim",
37
+
dependencies = "Glench/Vim-Jinja2-Syntax",
38
+
},
39
+
40
+
{
41
+
"nvim-treesitter/nvim-treesitter",
42
+
opts = {
43
+
ensure_installed = {
44
+
"vim",
45
+
"lua",
46
+
"vimdoc",
47
+
"html",
48
+
"htmldjango",
49
+
"css",
50
+
"markdown",
51
+
"markdown_inline",
52
+
"c",
53
+
"cpp",
54
+
"python",
55
+
"slint",
56
+
},
57
+
},
58
+
},
59
+
}
+23
nvim/.config/nvim/lua/plugins/rust.lua
+23
nvim/.config/nvim/lua/plugins/rust.lua
···
1
+
return {
2
+
{
3
+
"mrcjkb/rustaceanvim",
4
+
version = "^5", -- Recommended
5
+
lazy = false, -- This plugin is already lazy
6
+
},
7
+
8
+
{
9
+
"saecki/crates.nvim",
10
+
event = { "BufRead Cargo.toml" },
11
+
config = function()
12
+
require("crates").setup()
13
+
end,
14
+
},
15
+
16
+
{
17
+
"slint-ui/vim-slint",
18
+
config = function()
19
+
return require("lspconfig").slint_lsp.setup {}
20
+
end,
21
+
ft = { "slint" },
22
+
},
23
+
}
+43
nvim/README.md
+43
nvim/README.md
···
1
+
# bpavuk's Neovim config
2
+
3
+
Each language needs its own LSPs, and LSPs have their own dependencies. Here is
4
+
the list of everything you may ever need:
5
+
6
+
## Assembly
7
+
8
+
You need to have `cargo` installed. That's it.
9
+
10
+
## HTML/CSS
11
+
12
+
Install `nvm`.
13
+
14
+
## Rust
15
+
16
+
To get Rust working, install Rust with rustup (easy to google) and rust-analyzer with this:
17
+
```shell
18
+
rustup component add rust-analyzer
19
+
```
20
+
21
+
## C (maybe also C++)
22
+
23
+
To make autocomplete work, make sure you have clangd installed.
24
+
25
+
## Python
26
+
27
+
Install [Pyright](https://github.com/microsoft/pyright) and you are good to go.
28
+
```shell
29
+
pip install pyright
30
+
```
31
+
32
+
## Markdown
33
+
34
+
To get Markdown rendering working, install C or Zig compiler.
35
+
36
+
## Keybindings
37
+
38
+
- All NvChad bindings
39
+
- `<leader>a` - code action in supported languages
40
+
- `K` - smarter hover override in supported languages
41
+
- `<leader>R` - binding for running code
42
+
- `<leader>md` - toggles Markdown rendering
43
+