Update neovim

This commit is contained in:
Andrew Haynes
2026-03-07 13:48:54 -05:00
parent 57b150d64a
commit 79c25033cb
5 changed files with 78 additions and 47 deletions
+58 -6
View File
@@ -1,12 +1,15 @@
vim.opt.termguicolors = true vim.opt.termguicolors = true
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", "https://github.com/folke/lazy.nvim.git", lazypath }) local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable",
"https://github.com/folke/lazy.nvim.git", lazypath })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
{ "folke/tokyonight.nvim", lazy = false, {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000, priority = 1000,
opts = {}, opts = {},
}, },
@@ -16,13 +19,18 @@ require("lazy").setup({
{ "nvim-mini/mini.surround", version = '*' }, { "nvim-mini/mini.surround", version = '*' },
{ "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } }, { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } },
{ "saghen/blink.cmp", version = "v1.*", opts = {} }, { "saghen/blink.cmp", version = "v1.*", opts = {} },
{ dir = "/Users/andrew/personal/Projects/Lua/polydev/", {
dir = "/Users/andrew/personal/Projects/Lua/polydev/",
opts = { opts = {
terminal = { terminal = {
mode = "split", mode = "split",
} }
} }, }
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", branch = "master", },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
branch = "master",
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
highlight = { enable = true }, highlight = { enable = true },
@@ -30,10 +38,42 @@ require("lazy").setup({
}) })
end end
}, },
-- {
-- "mfussenegger/nvim-lint",
-- event = {
-- "BufReadPre",
-- "BufNewFile",
-- },
-- config = function()
-- local lint = require("lint")
--
-- lint.linters_by_ft = {
-- c = { "clangtidy" },
-- }
--
-- local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
--
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
-- group = lint_augroup,
-- callback = function()
-- lint.try_lint()
-- end,
-- })
--
-- vim.keymap.set("n", "<leader>l", function()
-- lint.try_lint()
-- end, { desc = "Trigger linting for current file" })
-- -- Customizing the linter arguments
-- local clangtidy = lint.linters.clangtidy
-- clangtidy.args = {
-- "-p", "build", -- Tell clang-tidy to look in the build folder for compile_commands.json
-- }
-- end,
-- }
} }
}) })
require ('colorizer').setup() require('colorizer').setup()
require('mini.pairs').setup() require('mini.pairs').setup()
require('mini.surround').setup() require('mini.surround').setup()
require("fzf-lua").setup({ require("fzf-lua").setup({
@@ -73,6 +113,7 @@ vim.opt.relativenumber = true
vim.opt.wrap = false vim.opt.wrap = false
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.signcolumn = "yes" vim.opt.signcolumn = "yes"
vim.opt.undofile = true -- Keeps undo history even after we close a file
vim.opt.scrolloff = 8 vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 8 vim.opt.sidescrolloff = 8
vim.opt.hlsearch = false vim.opt.hlsearch = false
@@ -80,6 +121,16 @@ vim.opt.completeopt = { "menuone", "noselect", "popup" }
vim.g.netrw_browse_split = 0 vim.g.netrw_browse_split = 0
vim.g.netrw_banner = 0 vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25 vim.g.netrw_winsize = 25
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
vim.opt.cursorline = true -- enable cursorline
vim.opt.cursorlineopt = { "screenline", "number" } -- cursorline look
vim.opt.shortmess =
'aF' -- abbreviates messages and prevents file name being echoed when opened
vim.opt.ignorecase = true -- ignore cases when searching
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
vim.opt.smartindent = true -- smarter indentation
vim.opt.smarttab = true -- make tab behaviour smarter
vim.opt.laststatus = 3
vim.cmd.colorscheme("tokyonight-moon") vim.cmd.colorscheme("tokyonight-moon")
vim.lsp.enable({ "lua_ls", "clangd" }) vim.lsp.enable({ "lua_ls", "clangd" })
vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
@@ -93,6 +144,7 @@ vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
vim.keymap.set("n", "<leader>ff", vim.lsp.buf.format) vim.keymap.set("n", "<leader>ff", vim.lsp.buf.format)
vim.keymap.set("n", "<leader>vs", ":vsplit<CR>") vim.keymap.set("n", "<leader>vs", ":vsplit<CR>")
vim.keymap.set("n", "<leader>ss", ":split<CR>")
vim.keymap.set("n", "<C-u>", "<C-u>zz") vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "<C-d>", "<C-d>zz") vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("x", "<leader>p", [["_dP]]) vim.keymap.set("x", "<leader>p", [["_dP]])
-10
View File
@@ -1,10 +0,0 @@
{
"struct": {
"prefix": "struct",
"body": [
"struct ${1:foo} {",
" ${2:pass}",
"};"
]
}
}
+5
View File
@@ -0,0 +1,5 @@
column_width = 80
line_endings = "Unix"
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferSingle"
-18
View File
@@ -1,15 +1,7 @@
"$schema" = 'https://starship.rs/config-schema.json' "$schema" = 'https://starship.rs/config-schema.json'
format = """ format = """
$username\
$hostname\
$directory\ $directory\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$python\
$character""" $character"""
[directory] [directory]
@@ -38,13 +30,3 @@ stashed = "≡"
[git_state] [git_state]
format = '\([$state( $progress_current/$progress_total)]($style)\) ' format = '\([$state( $progress_current/$progress_total)]($style)\) '
style = "bright-black" style = "bright-black"
[cmd_duration]
format = "[$duration]($style) "
style = "yellow"
[python]
format = "[$virtualenv]($style) "
style = "bright-black"
detect_extensions = []
detect_files = []
+2
View File
@@ -31,6 +31,7 @@ export PATH="$HOME/.local/bin:$PATH"
alias ls="ls -a --color" alias ls="ls -a --color"
# alias grep="rg" # alias grep="rg"
#
if [[ $(uname) != "Darwin" ]]; then if [[ $(uname) != "Darwin" ]]; then
alias update_world='doas emerge --ask --update --newuse --deep @world' alias update_world='doas emerge --ask --update --newuse --deep @world'
alias env="sh /home/andrew/personal/dotfiles/env_linux.sh" alias env="sh /home/andrew/personal/dotfiles/env_linux.sh"
@@ -38,6 +39,7 @@ else
alias env='sh ~/personal/dotfiles/env_mac.sh' alias env='sh ~/personal/dotfiles/env_mac.sh'
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib" export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
export PATH="$(brew --prefix llvm)/bin:$PATH" export PATH="$(brew --prefix llvm)/bin:$PATH"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export GOOGLE_CLOUD_PROJECT="development-477121" export GOOGLE_CLOUD_PROJECT="development-477121"
export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_ENV_HINTS=1 export HOMEBREW_NO_ENV_HINTS=1