-- Leader vim.g.mapleader = ";" vim.g.maplocalleader = "," -- These need to happend before we load plugins -- Load Plugins require("plugins") -- Color Scheme vim.cmd.colorscheme "catppuccin" --vim.cmd([[colorscheme kanagawa]]) -- Config for Nord, which I usually use --vim.g.nord_italic = false --vim.g.nord_bold = false --vim.opt.background = "light" vim.opt.background = "dark" -- Formatting and vim config vim.opt.expandtab = true vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 vim.opt.termguicolors = true vim.opt.cursorcolumn = true vim.opt.cursorline = true vim.opt.hidden = true vim.opt.colorcolumn = "120" vim.opt.spelllang = "en_us" vim.opt.number = false vim.opt.relativenumber = false -- I don't like word wrapping vim.opt.wrap = false vim.opt.mouse = vim.opt.mouse - "a" -- TODO: revisit this vim.opt.foldlevelstart = 20 vim.opt.conceallevel = 3 -- Show whitespace as dots vim.opt.lcs = vim.opt.lcs + "space:ยท" vim.opt.list = true vim.opt.textwidth = 88 -- No sexp wrapping parens vim.g.sexp_enable_insert_mode_mappings = 1 -- LuaLine Config require("lualine").setup( { options = { icons_enabled = true, theme = "auto" } } ) -- CTags vim.opt.tags = vim.opt.tags + vim.fn.expand("~/.local/tmp/ctags") + vim.fn.expand("~/repos/gerbil/src/TAGS") -- Conjure -- Gerbil Scheme local set_gerbil = function() vim.g["conjure#client#scheme#stdio#command"] = "gxi" vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "%d*> " vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = false end set_gerbil() vim.api.nvim_create_user_command("ConjureGerbil", set_gerbil, {}) -- Chibi-scheme local set_chibi = function() vim.g["conjure#client#scheme#stdio#command"] = "chibi-scheme -R" vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "=> $?" vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true end vim.api.nvim_create_user_command("ConjureChibi", set_chibi, {}) -- Chicken Scheme local set_chicken = function() vim.g["conjure#client#scheme#stdio#command"] = "csi -quiet -:c" vim.g["conjure#client#scheme#stdio#prompt_pattern"] = "\n-#;%d-> " vim.g["conjure#client#scheme#stdio#value_prefix_pattern"] = true end vim.api.nvim_create_user_command("ConjureChicken", set_chicken, {}) -- Neoformat vim.g.neoformat_run_all_formatters = 1 vim.g.neoformat_enabled_python = {"black", "docformatter", "isort"} vim.g.neoformat_python_black = { exe = "ruff", stdin = 1, args = {'format', '-q', '-'} } -- KEYMAPS local keymap = vim.api.nvim_set_keymap local noremap = {noremap = true} local silentnoremap = {noremap = true, silent = true} -- Easier breaking from edit modes keymap("n", ";;", "", noremap) keymap("v", ";;", "", noremap) keymap("i", ";;", "", noremap) keymap("t", "", "", noremap) -- Tab Navigation keymap("n", "tn", "tabnew", noremap) keymap("n", "tc", "tabclose", noremap) keymap("n", "", "tabnext", noremap) keymap("n", "tt", "tabnext", noremap) -- buffer navigation keymap("n", "h", "h", noremap) keymap("n", "j", "j", noremap) keymap("n", "k", "k", noremap) keymap("n", "l", "l", noremap) keymap("n", "bn", "bnext", noremap) keymap("n", "bp", "bprev", noremap) -- close buffer and put previous into current window keymap("n", "bq", "bp bd #", noremap) -- list buffers keymap("n", "bl", "ls", noremap) -- splits keymap("n", "vs", "vsplit", noremap) keymap("n", "ss", "split", noremap) keymap("n", "hs", "split", noremap) -- Toggle Line Numbers keymap("n", "n", "set number! number?", silentnoremap) -- Edit this file keymap("n", "ec", "e $MYVIMRC", silentnoremap) keymap("n", "sc", "source $MYVIMRC", silentnoremap) -- Clear highlights keymap("n", "", "noh", silentnoremap) -- Telescope shortcuts keymap("n", "ff", "Telescope find_files", silentnoremap) keymap("n", "fg", "Telescope live_grep", silentnoremap) keymap("n", "fb", "Telescope buffers", silentnoremap) keymap("n", "", "Telescope buffers", silentnoremap) keymap("n", "fh", "Telescope help_tags", silentnoremap) -- Remap arrow keys for page navigation keymap("n", "", "", silentnoremap) keymap("n", "", "", silentnoremap) keymap("n", "", "zh", silentnoremap) keymap("n", "", "zl", silentnoremap) -- LSP Documentation viewer keymap("n", "K", "lua vim.lsp.buf.hover()", silentnoremap) -- Autoformat! keymap("n", "", "Neoformat", silentnoremap) -- Python Specific vim.g.python3_host_prog = vim.fn.expand("~/.envs/nvim/bin/python3") -- Set up Treesitter require("nvim-treesitter.configs").setup( { highlight = { enable = true, disable = {} }, indent = { enable = false, disable = {} }, ensure_installed = { "c", "cpp", "capnp", "cmake", "bash", "dockerfile", "diff", "devicetree", "dot", "ebnf", "elixir", "erlang", "clojure", "fortran", "go", "gomod", "gosum", "graphql", "git_config", "git_rebase", "gitcommit", "gitignore", "gleam", "julia", "fish", "toml", "haskell", "hare", "http", "html", "ini", "json", "jq", "latex", "llvm", "mermaid", "make", "meson", "ninja", "yaml", "python", "proto", "racket", "rst", "scala", "html", "tsx", "rust", "scheme", "fennel", "lua", "markdown", "markdown_inline", "sql", "thrift", "typescript", "verilog", "vim", "zig", "uxntal" } } ) -- Set up Which Key? require("which-key").setup({}) -- ######################## --# Require other configs # -- ######################## -- LSP require("lsp") -- Completion require("completion")