mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-11 00:10: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
|
||||
copy this repo to ~/.config/nvim to nab my styles
|
||||
# nvim stuff
|
||||
|
||||
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
|
||||
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
|
||||
-- dofile(vim.g.base46_cache .. "defaults")
|
||||
-- dofile(vim.g.base46_cache .. "statusline")
|
||||
-- dofile(vim.g.base46_cache .. "syntax")
|
||||
-- dofile(vim.g.base46_cache .. "treesitter")
|
||||
-- dofile(vim.g.base46_cache .. "git")
|
||||
|
|
@ -41,5 +43,7 @@ end
|
|||
|
||||
vim.o.number = true
|
||||
-- require("nvim-tree.api").tree.open() -- open tree on start
|
||||
require "options"
|
||||
require "remaps"
|
||||
-- vim.schedule(function()
|
||||
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
|
||||
|
||||
local M = {
|
||||
disable_netrw = true,
|
||||
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 = {
|
||||
root_folder_label = false,
|
||||
highlight_git = true,
|
||||
highlight_opened_files = "none",
|
||||
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
},
|
||||
|
||||
icons = {
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
folder = {
|
||||
default = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
},
|
||||
git = { -- this is so stupid lmao
|
||||
unstaged = "😴",
|
||||
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
|
||||
|
|
|
|||
|
|
@ -6,9 +6,16 @@ return {
|
|||
"vim",
|
||||
"vimdoc",
|
||||
"go",
|
||||
"gomod",
|
||||
"ruby",
|
||||
"rust",
|
||||
"cpp",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"html",
|
||||
"css",
|
||||
"astro",
|
||||
"bash",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ M.ui = {
|
|||
modules = nil,
|
||||
},
|
||||
|
||||
-- lazyload it when there are 1+ buffers
|
||||
tabufline = {
|
||||
enabled = true,
|
||||
lazyload = false,
|
||||
|
|
|
|||
106
lua/options.lua
106
lua/options.lua
|
|
@ -1,53 +1,63 @@
|
|||
vim.o.mouse = "nv"
|
||||
vim.o.mousemodel = "extend"
|
||||
local opt = vim.opt
|
||||
local o = vim.o
|
||||
local g = vim.g
|
||||
|
||||
-- optimization for WSL
|
||||
-- vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||
-- 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",
|
||||
--})
|
||||
-------------------------------------- globals -----------------------------------------
|
||||
g.toggle_theme_icon = " "
|
||||
|
||||
-- enable cursor line
|
||||
vim.o.cursorlineopt = "both"
|
||||
-------------------------------------- options ------------------------------------------
|
||||
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
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ return {
|
|||
formatters_by_ft = {
|
||||
bash = { "shfmt" },
|
||||
sh = { "shfmt" },
|
||||
fish = { "fish_indent" },
|
||||
lua = { "stylua" },
|
||||
go = { "goimports", "gofumpt", "goimports-reviser" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
event = "User FilePost",
|
||||
opts = {
|
||||
indent = { char = "│", highlight = "IblChar" },
|
||||
scope = { char = "│", highlight = "IblScopeChar" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
dofile(vim.g.base46_cache .. "blankline")
|
||||
|
||||
local hooks = require "ibl.hooks"
|
||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||
require("ibl").setup(opts)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@ return {
|
|||
handlers = {
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
require("lspconfig").lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ return {
|
|||
opts = function()
|
||||
return { override = require "nvchad.icons.devicons" }
|
||||
end,
|
||||
-- opts = {},
|
||||
opts = function()
|
||||
require "configs.nvim-tree"
|
||||
end,
|
||||
config = function(_, opts)
|
||||
dofile(vim.g.base46_cache .. "devicons")
|
||||
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>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>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
|
||||
map("n", "<leader>th", "<cmd>Telescope themes<CR>", { desc = "[th]emes" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue