diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4489f00..7358a5f 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,28 +1,36 @@ vim.opt.termguicolors = true local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 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 vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { - { "folke/tokyonight.nvim", lazy = false, + { + "folke/tokyonight.nvim", + lazy = false, priority = 1000, opts = {}, }, { "norcalli/nvim-colorizer.lua" }, { "mbbill/undotree" }, - { "nvim-mini/mini.pairs", version = '*' }, - { "nvim-mini/mini.surround", version = '*' }, - { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } }, - { "saghen/blink.cmp", version = "v1.*", opts = {} }, - { dir = "/Users/andrew/personal/Projects/Lua/polydev/", + { "nvim-mini/mini.pairs", version = '*' }, + { "nvim-mini/mini.surround", version = '*' }, + { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" } }, + { "saghen/blink.cmp", version = "v1.*", opts = {} }, + { + dir = "/Users/andrew/personal/Projects/Lua/polydev/", opts = { terminal = { mode = "split", } - } }, - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", branch = "master", + } + }, + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + branch = "master", config = function() require("nvim-treesitter.configs").setup({ highlight = { enable = true }, @@ -30,10 +38,42 @@ require("lazy").setup({ }) 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", "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.surround').setup() require("fzf-lua").setup({ @@ -44,15 +84,15 @@ require("fzf-lua").setup({ }, }, winopts = { - height = 0.50, - width = 0.45, - row = 0.35, - col = 0.50, - border = "rounded", - backdrop = 0, - fullscreen = false, - preview = { - hidden = true, + height = 0.50, + width = 0.45, + row = 0.35, + col = 0.50, + border = "rounded", + backdrop = 0, + fullscreen = false, + preview = { + hidden = true, }, }, grep = { @@ -73,6 +113,7 @@ vim.opt.relativenumber = true vim.opt.wrap = false vim.opt.swapfile = false vim.opt.signcolumn = "yes" +vim.opt.undofile = true -- Keeps undo history even after we close a file vim.opt.scrolloff = 8 vim.opt.sidescrolloff = 8 vim.opt.hlsearch = false @@ -80,6 +121,16 @@ vim.opt.completeopt = { "menuone", "noselect", "popup" } vim.g.netrw_browse_split = 0 vim.g.netrw_banner = 0 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.lsp.enable({ "lua_ls", "clangd" }) vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) @@ -93,6 +144,7 @@ vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("n", "ff", vim.lsp.buf.format) vim.keymap.set("n", "vs", ":vsplit") +vim.keymap.set("n", "ss", ":split") vim.keymap.set("n", "", "zz") vim.keymap.set("n", "", "zz") vim.keymap.set("x", "p", [["_dP]]) diff --git a/.config/nvim/snippets/cpp.json b/.config/nvim/snippets/cpp.json deleted file mode 100644 index 8852948..0000000 --- a/.config/nvim/snippets/cpp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "struct": { - "prefix": "struct", - "body": [ - "struct ${1:foo} {", - " ${2:pass}", - "};" - ] - } -} diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml new file mode 100644 index 0000000..c6015eb --- /dev/null +++ b/.config/nvim/stylua.toml @@ -0,0 +1,5 @@ +column_width = 80 +line_endings = "Unix" +indent_type = "Tabs" +indent_width = 4 +quote_style = "AutoPreferSingle" diff --git a/.config/starship.toml b/.config/starship.toml index 14d91b3..92b0392 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,15 +1,7 @@ "$schema" = 'https://starship.rs/config-schema.json' format = """ -$username\ -$hostname\ $directory\ -$git_branch\ -$git_state\ -$git_status\ -$cmd_duration\ -$line_break\ -$python\ $character""" [directory] @@ -38,13 +30,3 @@ stashed = "≡" [git_state] format = '\([$state( $progress_current/$progress_total)]($style)\) ' style = "bright-black" - -[cmd_duration] -format = "[$duration]($style) " -style = "yellow" - -[python] -format = "[$virtualenv]($style) " -style = "bright-black" -detect_extensions = [] -detect_files = [] diff --git a/.zshrc b/.zshrc index 59776a9..1fdac09 100644 --- a/.zshrc +++ b/.zshrc @@ -31,6 +31,7 @@ export PATH="$HOME/.local/bin:$PATH" alias ls="ls -a --color" # alias grep="rg" +# if [[ $(uname) != "Darwin" ]]; then alias update_world='doas emerge --ask --update --newuse --deep @world' alias env="sh /home/andrew/personal/dotfiles/env_linux.sh" @@ -38,6 +39,7 @@ else alias env='sh ~/personal/dotfiles/env_mac.sh' export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib" export PATH="$(brew --prefix llvm)/bin:$PATH" + export MANPAGER="sh -c 'col -bx | bat -l man -p'" export GOOGLE_CLOUD_PROJECT="development-477121" export HOMEBREW_NO_AUTO_UPDATE=1 export HOMEBREW_NO_ENV_HINTS=1