mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-13 09:20:30 -07:00
fix statusline + some lsp stuff
This commit is contained in:
parent
cc4abb76ee
commit
d9d98ca2c8
12 changed files with 216 additions and 60 deletions
|
|
@ -1,2 +1,7 @@
|
||||||
# my nvchad setup
|
# nvim stuff
|
||||||
copy this repo to ~/.config/nvim to nab my styles
|
|
||||||
|
i like nvchad but i rewrote this to not use the distro anymore (but still using ui and bas46 plugin from chad :P)
|
||||||
|
|
||||||
|
clone repo into ~./config to nab my styles
|
||||||
|
|
||||||
|
note that base46 didnt work until i ran `require('base46').load_all_highlights()` manually
|
||||||
|
|
|
||||||
10
init.lua
10
init.lua
|
|
@ -23,10 +23,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
require("lazy").setup { import = "plugins" }
|
local lazy_config = require "configs.lazy"
|
||||||
|
require("lazy").setup({ import = "plugins" }, lazy_config)
|
||||||
|
|
||||||
-- more nvchad ui stuff
|
-- more nvchad ui stuff
|
||||||
-- dofile(vim.g.base46_cache .. "defaults")
|
-- dofile(vim.g.base46_cache .. "defaults")
|
||||||
|
-- dofile(vim.g.base46_cache .. "statusline")
|
||||||
-- dofile(vim.g.base46_cache .. "syntax")
|
-- dofile(vim.g.base46_cache .. "syntax")
|
||||||
-- dofile(vim.g.base46_cache .. "treesitter")
|
-- dofile(vim.g.base46_cache .. "treesitter")
|
||||||
-- dofile(vim.g.base46_cache .. "git")
|
-- dofile(vim.g.base46_cache .. "git")
|
||||||
|
|
@ -41,5 +43,7 @@ end
|
||||||
|
|
||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
-- require("nvim-tree.api").tree.open() -- open tree on start
|
-- require("nvim-tree.api").tree.open() -- open tree on start
|
||||||
require "options"
|
-- vim.schedule(function()
|
||||||
require "remaps"
|
require "options"
|
||||||
|
require "remaps"
|
||||||
|
-- end)
|
||||||
|
|
|
||||||
47
lua/configs/lazy.lua
Normal file
47
lua/configs/lazy.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
return {
|
||||||
|
defaults = { lazy = true },
|
||||||
|
install = { colorscheme = { "nvchad" } },
|
||||||
|
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
ft = "",
|
||||||
|
lazy = " ",
|
||||||
|
loaded = "",
|
||||||
|
not_loaded = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
disabled_plugins = {
|
||||||
|
"2html_plugin",
|
||||||
|
"tohtml",
|
||||||
|
"getscript",
|
||||||
|
"getscriptPlugin",
|
||||||
|
"gzip",
|
||||||
|
"logipat",
|
||||||
|
"netrw",
|
||||||
|
"netrwPlugin",
|
||||||
|
"netrwSettings",
|
||||||
|
"netrwFileHandlers",
|
||||||
|
"matchit",
|
||||||
|
"tar",
|
||||||
|
"tarPlugin",
|
||||||
|
"rrhelper",
|
||||||
|
"spellfile_plugin",
|
||||||
|
"vimball",
|
||||||
|
"vimballPlugin",
|
||||||
|
"zip",
|
||||||
|
"zipPlugin",
|
||||||
|
"tutor",
|
||||||
|
"rplugin",
|
||||||
|
"syntax",
|
||||||
|
"synmenu",
|
||||||
|
"optwin",
|
||||||
|
"compiler",
|
||||||
|
"bugreport",
|
||||||
|
"ftplugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -5,12 +5,67 @@ local function on_attach(bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
disable_netrw = true,
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
git = { ignore = false },
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
},
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
hijack_cursor = true,
|
||||||
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
|
sync_root_with_cwd = true,
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_root = false,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
adaptive_size = false,
|
||||||
|
side = "left",
|
||||||
|
width = 30,
|
||||||
|
preserve_window_proportions = true,
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = false,
|
||||||
|
},
|
||||||
|
filesystem_watchers = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
resize_window = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
renderer = {
|
renderer = {
|
||||||
|
root_folder_label = false,
|
||||||
|
highlight_git = true,
|
||||||
|
highlight_opened_files = "none",
|
||||||
|
|
||||||
|
indent_markers = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
|
||||||
icons = {
|
icons = {
|
||||||
|
show = {
|
||||||
|
file = true,
|
||||||
|
folder = true,
|
||||||
|
folder_arrow = true,
|
||||||
|
git = true,
|
||||||
|
},
|
||||||
|
|
||||||
glyphs = {
|
glyphs = {
|
||||||
|
default = "",
|
||||||
|
symlink = "",
|
||||||
|
folder = {
|
||||||
|
default = "",
|
||||||
|
empty = "",
|
||||||
|
empty_open = "",
|
||||||
|
open = "",
|
||||||
|
symlink = "",
|
||||||
|
symlink_open = "",
|
||||||
|
arrow_open = "",
|
||||||
|
arrow_closed = "",
|
||||||
|
},
|
||||||
git = { -- this is so stupid lmao
|
git = { -- this is so stupid lmao
|
||||||
unstaged = "😴",
|
unstaged = "😴",
|
||||||
staged = "😎",
|
staged = "😎",
|
||||||
|
|
@ -24,4 +79,24 @@ local M = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- local M = {
|
||||||
|
-- disable_netrw = true,
|
||||||
|
-- on_attach = on_attach,
|
||||||
|
-- git = { ignore = false },
|
||||||
|
-- renderer = {
|
||||||
|
-- icons = {
|
||||||
|
-- glyphs = {
|
||||||
|
-- git = { -- this is so stupid lmao
|
||||||
|
-- unstaged = "😴",
|
||||||
|
-- staged = "😎",
|
||||||
|
-- unmerged = "😈",
|
||||||
|
-- untracked = "😭",
|
||||||
|
-- renamed = "😶",
|
||||||
|
-- deleted = "😵",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,16 @@ return {
|
||||||
"vim",
|
"vim",
|
||||||
"vimdoc",
|
"vimdoc",
|
||||||
"go",
|
"go",
|
||||||
|
"gomod",
|
||||||
"ruby",
|
"ruby",
|
||||||
"rust",
|
"rust",
|
||||||
"cpp",
|
"cpp",
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"astro",
|
||||||
|
"bash",
|
||||||
},
|
},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ M.ui = {
|
||||||
modules = nil,
|
modules = nil,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lazyload it when there are 1+ buffers
|
|
||||||
tabufline = {
|
tabufline = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
lazyload = false,
|
lazyload = false,
|
||||||
|
|
|
||||||
106
lua/options.lua
106
lua/options.lua
|
|
@ -1,53 +1,63 @@
|
||||||
vim.o.mouse = "nv"
|
local opt = vim.opt
|
||||||
vim.o.mousemodel = "extend"
|
local o = vim.o
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
-- optimization for WSL
|
-------------------------------------- globals -----------------------------------------
|
||||||
-- vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
g.toggle_theme_icon = " "
|
||||||
-- once = true,
|
|
||||||
-- callback = function()
|
|
||||||
-- if vim.fn.has "win32" == 1 or vim.fn.has "wsl" == 1 then
|
|
||||||
-- vim.g.clipboard = {
|
|
||||||
-- copy = {
|
|
||||||
-- ["+"] = "win32yank.exe -i --crlf",
|
|
||||||
-- ["*"] = "win32yank.exe -i --crlf",
|
|
||||||
-- },
|
|
||||||
-- paste = {
|
|
||||||
-- ["+"] = "win32yank.exe -o --lf",
|
|
||||||
-- ["*"] = "win32yank.exe -o --lf",
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- elseif vim.fn.has "unix" == 1 then
|
|
||||||
-- if vim.fn.executable "xclip" == 1 then
|
|
||||||
-- vim.g.clipboard = {
|
|
||||||
-- copy = {
|
|
||||||
-- ["+"] = "xclip -selection clipboard",
|
|
||||||
-- ["*"] = "xclip -selection clipboard",
|
|
||||||
-- },
|
|
||||||
-- paste = {
|
|
||||||
-- ["+"] = "xclip -selection clipboard -o",
|
|
||||||
-- ["*"] = "xclip -selection clipboard -o",
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- elseif vim.fn.executable "xsel" == 1 then
|
|
||||||
-- vim.g.clipboard = {
|
|
||||||
-- copy = {
|
|
||||||
-- ["+"] = "xsel --clipboard --input",
|
|
||||||
-- ["*"] = "xsel --clipboard --input",
|
|
||||||
-- },
|
|
||||||
-- paste = {
|
|
||||||
-- ["+"] = "xsel --clipboard --output",
|
|
||||||
-- ["*"] = "xsel --clipboard --output",
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- vim.opt.clipboard = "unnamedplus"
|
|
||||||
-- end,
|
|
||||||
-- desc = "Lazy load clipboard",
|
|
||||||
--})
|
|
||||||
|
|
||||||
-- enable cursor line
|
-------------------------------------- options ------------------------------------------
|
||||||
vim.o.cursorlineopt = "both"
|
o.laststatus = 3
|
||||||
|
o.showmode = false
|
||||||
|
|
||||||
|
o.clipboard = "unnamedplus"
|
||||||
|
o.cursorline = true
|
||||||
|
o.cursorlineopt = "number"
|
||||||
|
|
||||||
|
-- Indenting
|
||||||
|
o.expandtab = true
|
||||||
|
o.shiftwidth = 2
|
||||||
|
o.smartindent = true
|
||||||
|
o.tabstop = 2
|
||||||
|
o.softtabstop = 2
|
||||||
|
|
||||||
|
opt.fillchars = { eob = " " }
|
||||||
|
o.ignorecase = true
|
||||||
|
o.smartcase = true
|
||||||
|
o.mouse = "nv"
|
||||||
|
o.mousemodel = "extend"
|
||||||
|
|
||||||
|
-- Numbers
|
||||||
|
o.number = true
|
||||||
|
o.numberwidth = 2
|
||||||
|
o.ruler = false
|
||||||
|
|
||||||
|
-- disable nvim intro
|
||||||
|
opt.shortmess:append "sI"
|
||||||
|
|
||||||
|
o.signcolumn = "yes"
|
||||||
|
o.splitbelow = true
|
||||||
|
o.splitright = true
|
||||||
|
o.timeoutlen = 400
|
||||||
|
o.undofile = true
|
||||||
|
|
||||||
|
-- interval for writing swap file to disk, also used by gitsigns
|
||||||
|
o.updatetime = 250
|
||||||
|
|
||||||
|
-- go to previous/next line with h,l,left arrow and right arrow
|
||||||
|
-- when cursor reaches end/beginning of line
|
||||||
|
opt.whichwrap:append "<>[]hl"
|
||||||
|
|
||||||
|
-- g.mapleader = " "
|
||||||
|
|
||||||
|
-- disable some default providers
|
||||||
|
vim.g["loaded_node_provider"] = 0
|
||||||
|
vim.g["loaded_python3_provider"] = 0
|
||||||
|
vim.g["loaded_perl_provider"] = 0
|
||||||
|
vim.g["loaded_ruby_provider"] = 0
|
||||||
|
|
||||||
|
-- add binaries installed by mason.nvim to path
|
||||||
|
local is_windows = vim.fn.has "win32" ~= 0
|
||||||
|
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
|
||||||
|
|
||||||
-- Highlight on yank
|
-- Highlight on yank
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ return {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
bash = { "shfmt" },
|
bash = { "shfmt" },
|
||||||
sh = { "shfmt" },
|
sh = { "shfmt" },
|
||||||
fish = { "fish_indent" },
|
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
go = { "goimports", "gofumpt", "goimports-reviser" },
|
go = { "goimports", "gofumpt", "goimports-reviser" },
|
||||||
javascript = { { "prettierd", "prettier" } },
|
javascript = { { "prettierd", "prettier" } },
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
return {
|
return {
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
main = "ibl",
|
||||||
event = "User FilePost",
|
event = "User FilePost",
|
||||||
opts = {
|
opts = {
|
||||||
indent = { char = "│", highlight = "IblChar" },
|
indent = { char = "│", highlight = "IblChar" },
|
||||||
scope = { char = "│", highlight = "IblScopeChar" },
|
scope = { char = "│", highlight = "IblScopeChar" },
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
dofile(vim.g.base46_cache .. "blankline")
|
|
||||||
|
|
||||||
local hooks = require "ibl.hooks"
|
local hooks = require "ibl.hooks"
|
||||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||||
require("ibl").setup(opts)
|
require("ibl").setup(opts)
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,13 @@ return {
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require("lspconfig")[server_name].setup {}
|
require("lspconfig")[server_name].setup {}
|
||||||
|
require("lspconfig").lua_ls.setup {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@ return {
|
||||||
opts = function()
|
opts = function()
|
||||||
return { override = require "nvchad.icons.devicons" }
|
return { override = require "nvchad.icons.devicons" }
|
||||||
end,
|
end,
|
||||||
-- opts = {},
|
opts = function()
|
||||||
|
require "configs.nvim-tree"
|
||||||
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
dofile(vim.g.base46_cache .. "devicons")
|
dofile(vim.g.base46_cache .. "devicons")
|
||||||
require("nvim-web-devicons").setup(opts)
|
require("nvim-web-devicons").setup(opts)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ map("n", "<leader>pg", builtin.live_grep, { desc = "[p]roject [g]rep" })
|
||||||
map("n", "<leader>fb", builtin.buffers, { desc = "[f]ind [b]uffer" })
|
map("n", "<leader>fb", builtin.buffers, { desc = "[f]ind [b]uffer" })
|
||||||
map("n", "<leader>fh", builtin.help_tags, { desc = "[f]ind [h]elp" })
|
map("n", "<leader>fh", builtin.help_tags, { desc = "[f]ind [h]elp" })
|
||||||
map("n", "<leader>fg", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "[f]ile [g]rep" })
|
map("n", "<leader>fg", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "[f]ile [g]rep" })
|
||||||
|
map("n", "<leader>cm", "<cmd>Telescope git_commits<CR>", { desc = "Telescope Git commits" })
|
||||||
|
map("n", "<leader>gt", "<cmd>Telescope git_status<CR>", { desc = "Telescope Git status" })
|
||||||
|
|
||||||
-- base46 maps
|
-- base46 maps
|
||||||
map("n", "<leader>th", "<cmd>Telescope themes<CR>", { desc = "[th]emes" })
|
map("n", "<leader>th", "<cmd>Telescope themes<CR>", { desc = "[th]emes" })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue