fix statusline + some lsp stuff

scratch
Gabe Farrell 2 years ago
parent cc4abb76ee
commit d9d98ca2c8

@ -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

@ -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)

@ -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,

@ -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
-- vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { -------------------------------------- globals -----------------------------------------
-- once = true, g.toggle_theme_icon = ""
-- callback = function()
-- if vim.fn.has "win32" == 1 or vim.fn.has "wsl" == 1 then -------------------------------------- options ------------------------------------------
-- vim.g.clipboard = { o.laststatus = 3
-- copy = { o.showmode = false
-- ["+"] = "win32yank.exe -i --crlf",
-- ["*"] = "win32yank.exe -i --crlf", o.clipboard = "unnamedplus"
-- }, o.cursorline = true
-- paste = { o.cursorlineopt = "number"
-- ["+"] = "win32yank.exe -o --lf",
-- ["*"] = "win32yank.exe -o --lf", -- Indenting
-- }, o.expandtab = true
-- } o.shiftwidth = 2
-- elseif vim.fn.has "unix" == 1 then o.smartindent = true
-- if vim.fn.executable "xclip" == 1 then o.tabstop = 2
-- vim.g.clipboard = { o.softtabstop = 2
-- copy = {
-- ["+"] = "xclip -selection clipboard", opt.fillchars = { eob = " " }
-- ["*"] = "xclip -selection clipboard", o.ignorecase = true
-- }, o.smartcase = true
-- paste = { o.mouse = "nv"
-- ["+"] = "xclip -selection clipboard -o", o.mousemodel = "extend"
-- ["*"] = "xclip -selection clipboard -o",
-- }, -- Numbers
-- } o.number = true
-- elseif vim.fn.executable "xsel" == 1 then o.numberwidth = 2
-- vim.g.clipboard = { o.ruler = false
-- copy = {
-- ["+"] = "xsel --clipboard --input", -- disable nvim intro
-- ["*"] = "xsel --clipboard --input", opt.shortmess:append "sI"
-- },
-- paste = { o.signcolumn = "yes"
-- ["+"] = "xsel --clipboard --output", o.splitbelow = true
-- ["*"] = "xsel --clipboard --output", o.splitright = true
-- }, o.timeoutlen = 400
-- } o.undofile = true
-- end
-- end -- interval for writing swap file to disk, also used by gitsigns
-- vim.opt.clipboard = "unnamedplus" o.updatetime = 250
-- end,
-- desc = "Lazy load clipboard", -- go to previous/next line with h,l,left arrow and right arrow
--}) -- when cursor reaches end/beginning of line
opt.whichwrap:append "<>[]hl"
-- enable cursor line
vim.o.cursorlineopt = "both" -- 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…
Cancel
Save