Moving config and local to (dot) prefix

This commit is contained in:
2026-06-01 16:41:36 +01:00
parent d6561d9d20
commit 904819fba5
32615 changed files with 0 additions and 0 deletions

109
.config/nvim/init.lua Normal file
View File

@@ -0,0 +1,109 @@
-- Leader
vim.g.mapleader = " "
-- Sync system clipboard and neovim register
vim.opt.clipboard = { "unnamedplus" }
-- Save undo history
vim.opt.undofile = true
--
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Remove sign column (LSP gutter on the left)
vim.opt.signcolumn = "yes"
-- Line Numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Tabs
vim.o.tabstop = 4 -- A TAB character looks like 4 spaces
vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
-- Modules --
-- Lazy = Package Manager --
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")
-- LSP Ignore error
for _, method in ipairs({ "textDocument/diagnostic", "workspace/diagnostic" }) do
local default_diagnostic_handler = vim.lsp.handlers[method]
vim.lsp.handlers[method] = function(err, result, context, config)
if err ~= nil and err.code == -32802 then
return
end
return default_diagnostic_handler(err, result, context, config)
end
end
-- Mappings
-- Save --
vim.keymap.set("n", "<C-s>", "<Cmd>w<CR>")
-- Split navigation --
vim.keymap.set("n", "<C-h>", "<C-w>h")
vim.keymap.set("n", "<C-j>", "<C-w>j")
vim.keymap.set("n", "<C-k>", "<C-w>k")
vim.keymap.set("n", "<C-l>", "<C-w>l")
-- Buffers --
vim.keymap.set("n", "<leader>x", "<Cmd>bd<CR>")
-- Telescope Mappings --
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope find files" })
vim.keymap.set("n", "<leader>fw", builtin.live_grep, { desc = "Telescope live grep" })
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope live buffers" })
-- Neo Tree --
vim.keymap.set("n", "<C-n>", "<Cmd> Neotree toggle <CR>")
vim.keymap.set("n", "<leader>e", "<Cmd> Neotree focus <CR>")
-- LSP --
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
vim.keymap.set("n", "<leader>ra", vim.lsp.buf.rename)
vim.keymap.set("n", "<leader>lf", vim.diagnostic.open_float)
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references)
-- Search --
vim.keymap.set("n", "<ESC>", "<Cmd> noh <CR>")
-- Tmux navigator --
vim.keymap.set("n", "<c-h>", "<cmd>TmuxNavigateLeft<cr>")
vim.keymap.set("n", "<c-j>", "<cmd>TmuxNavigateDown<cr>")
vim.keymap.set("n", "<c-k>", "<cmd>TmuxNavigateUp<cr>")
vim.keymap.set("n", "<c-l>", "<cmd>TmuxNavigateRight<cr>")
vim.keymap.set("n", "<c-\\>", "<cmd>TmuxNavigatePrevious<cr>")
-- Floating Terminal --
vim.keymap.set("n", "<A-k>", "<cmd>ToggleTerm direction=float<cr>")
vim.keymap.set("t", "<A-k>", "<cmd>ToggleTerm direction=float<cr>")
-- TODO: shift this over now that lsp-config is no longer needed
-- doesnt work?
-- vim.lsp.enable("ty")

View File

@@ -0,0 +1,21 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
"conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gruvbox-material": { "branch": "master", "commit": "f5f912fbc7cf2d45da6928b792d554f85c7aa89a" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-lspconfig": { "branch": "master", "commit": "38da5bbe1eaab2394056109e48c7e195bdb8fdfe" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" },
"vim-wakatime": { "branch": "master", "commit": "f39c4a201ae350aaba713b59d4a4fdd88e0811aa" }
}

View File

@@ -0,0 +1,166 @@
return {
{ "wakatime/vim-wakatime", lazy = false },
{
"stevearc/conform.nvim",
config = function()
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
rust = { "rustfmt", lsp_format = "fallback" },
javascript = { "prettierd", "prettier", stop_after_first = true },
python = { "ruff_format" },
},
format_on_save = {
lsp_format = "fallback",
},
})
end,
},
{
"numToStr/Comment.nvim",
},
{ "akinsho/toggleterm.nvim", version = "*", config = true },
{
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
},
{
"sainnhe/gruvbox-material",
lazy = false,
config = function()
-- Optionally configure and load the colorscheme
-- directly inside the plugin declaration.
vim.g.gruvbox_material_enable_italic = true
vim.g.gruvbox_material_background = "hard"
vim.cmd.colorscheme("gruvbox-material")
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
-- require("telescope").load_extension("fzf")
end,
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
modules = {},
ignore_install = {},
auto_install = true,
ensure_installed = { "lua", "javascript", "typescript", "html", "tsx", "zig" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
{
"s1n7ax/nvim-window-picker",
version = "2.*",
config = function()
require("window-picker").setup({
filter_rules = {
include_current_win = false,
autoselect_one = true,
-- filter using buffer options
bo = {
-- if the file type is one of following, the window will be ignored
filetype = { "neo-tree", "neo-tree-popup", "notify" },
-- if the buffer type is one of following, the window will be ignored
buftype = { "terminal", "quickfix" },
},
},
})
end,
},
},
config = function()
require("neo-tree").setup({
filesystem = {
follow_current_file = {
enabled = true,
},
},
close_if_last_window = false,
})
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local lsp = require("lspconfig")
local clients = { "vtsls", "zls", "gopls", "tailwindcss", "ocamllsp", "svelte", "biome", "pylsp", "svelte" }
for _, value in pairs(clients) do
lsp[value].setup({})
end
lsp.lua_ls.setup({
settings = {
Lua = {
diagnostics = { globals = { "vim", "require" } },
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
},
},
})
lsp.rust_analyzer.setup({
diagnostic = {
-- Prevents the annoying popup for cancalled requests
refreshSupport = false,
},
})
end,
},
{
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = { "rafamadriz/friendly-snippets" },
opts = {
keymap = { preset = "enter" },
appearance = {
nerd_font_variant = "mono",
},
completion = { documentation = { auto_show = false } },
sources = {
default = { "lsp", "path", "snippets" },
},
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
},
}