--- /dev/null
+lazy-lock.json
--- /dev/null
+ # dotfiles repo
+
+ This is a public version of my dotfiles.
--- /dev/null
+require("main")
+require("plugin")
--- /dev/null
+require("main.lazy")
+require("main.remaps")
+
+vim.opt.termguicolors = true
+vim.cmd [[colorscheme tokyonight]]
+vim.wo.number = true
+vim.wo.relativenumber = true
+vim.opt.clipboard = 'unnamedplus'
+
+vim.o.expandtab = true
+vim.o.smartindent = true
+vim.o.tabstop = 2
+vim.o.shiftwidth = 2
+
+vim.opt.hlsearch = false
+vim.opt.incsearch = true
+
+vim.o.autoread = true
+vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, {
+ command = "if mode() != 'c' | checktime | endif",
+ pattern = { "*" },
+})
+
+vim.opt.updatetime = 50
+
+vim.opt.signcolumn = "yes"
+-- vim.opt.colorcolumn = "80"
+
+vim.opt.spelllang = 'en_us'
+vim.opt.spell = false
--- /dev/null
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+
+plugins = {
+ {
+ 'nvim-telescope/telescope.nvim',
+ dependencies = { 'nvim-lua/plenary.nvim' },
+ lazy = false
+ },
+ {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ lazy = false
+ },
+ {
+ "folke/tokyonight.nvim",
+ lazy = false,
+ priority = 1000,
+ opts = {},
+ },
+ {
+ "nvim-lua/plenary.nvim",
+ lazy = false
+ },
+ {
+ "ThePrimeagen/harpoon",
+ lazy = false
+ },
+ { 'akinsho/toggleterm.nvim', version = "*", config = true, lazy = false },
+ { "gbprod/yanky.nvim", lazy = false },
+ { "mbbill/undotree", lazy = false },
+ { "tpope/vim-fugitive", lazy = false },
+ {
+ "folke/todo-comments.nvim",
+ dependencies = { "nvim-lua/plenary.nvim" },
+ opts = {},
+ lazy = false
+ },
+ {
+ "folke/trouble.nvim",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ lazy = false
+ },
+ { "rcarriga/nvim-notify", lazy = false },
+ {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v2.x',
+ dependencies = {
+ -- LSP Support
+ { 'neovim/nvim-lspconfig' }, -- Required
+ { -- Optional
+ 'williamboman/mason.nvim',
+ build = function()
+ pcall(vim.api.nvim_command, 'MasonUpdate')
+ end,
+ },
+ { 'williamboman/mason-lspconfig.nvim' }, -- Optional
+
+ -- Autocompletion
+ { 'hrsh7th/nvim-cmp' }, -- Required
+ { 'hrsh7th/cmp-nvim-lsp' }, -- Required
+ { 'L3MON4D3/LuaSnip' }, -- Required
+ },
+
+ },
+ {
+ 'nvim-lualine/lualine.nvim',
+ requires = { 'nvim-tree/nvim-web-devicons', opt = true }
+ },
+ {
+ "folke/persistence.nvim",
+ event = "BufReadPre", -- this will only start session saving when an actual file was opened
+ opts = {
+ }
+ }
+}
+
+require("lazy").setup(plugins)
--- /dev/null
+vim.g.mapleader = " "
+vim.keymap.set("n", "<leader>fv", vim.cmd.Ex)
--- /dev/null
+vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
--- /dev/null
+local mark = require("harpoon.mark")
+local ui = require("harpoon.ui")
+
+vim.keymap.set("n", "<leader>ha", mark.add_file)
+vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
+
+vim.keymap.set("n", "<leader>hn", function() ui.nav_next() end)
+vim.keymap.set("n", "<leader>hp", function() ui.nav_prev() end)
--- /dev/null
+require("plugin.telescope")
+require("plugin.treesitter")
+require("plugin.harpoon")
+require("plugin.toggleterm")
+require("plugin.yanky")
+require("plugin.undotree")
+require("plugin.fugitive")
+require("plugin.todo")
+require("plugin.trouble")
+require("plugin.notify")
+require("plugin.mason")
+require("plugin.lspzero")
+require("plugin.lualine")
+require("plugin.persistence")
--- /dev/null
+local lsp = require('lsp-zero').preset(
+ {
+ float_border = 'rounded',
+ call_servers = 'local',
+ configure_diagnostics = true,
+ setup_servers_on_start = true,
+ set_lsp_keymaps = false,
+ manage_nvim_cmp = {
+ set_sources = 'lsp',
+ set_basic_mappings = true,
+ set_extra_mappings = true,
+ use_luasnip = true,
+ set_format = true,
+ documentation_window = true,
+ }
+ }
+)
+
+lsp.on_attach(function(client, bufnr)
+ -- see :help lsp-zero-keybindings
+ -- to learn the available actions
+ lsp.default_keymaps({ buffer = bufnr })
+end)
+
+vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
+
+lsp.setup()
--- /dev/null
+require('lualine').setup()
--- /dev/null
+vim.notify = require("notify")
+-- require("telescope").load_extension("notify")
+-- require('telescope').extensions.notify.notify({})
--- /dev/null
+vim.api.nvim_set_keymap("n", "<leader>qs", [[<cmd>lua require("persistence").load()<cr>]], {})
--- /dev/null
+local builtin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
+vim.keymap.set('n', '<leader>fg', builtin.git_files, {})
+vim.keymap.set('n', '<leader>fs', builtin.live_grep, {})
+vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+
+local actions = require("telescope.actions")
+local trouble = require("trouble.providers.telescope")
+
+local telescope = require("telescope")
+
+telescope.setup {
+ defaults = {
+ mappings = {
+ i = { ["<c-t>"] = trouble.open_with_trouble },
+ n = { ["<c-t>"] = trouble.open_with_trouble },
+ },
+ },
+}
--- /dev/null
+vim.keymap.set("n", "]t", function()
+ require("todo-comments").jump_next()
+end, { desc = "Next todo comment" })
+
+vim.keymap.set("n", "[t", function()
+ require("todo-comments").jump_prev()
+end, { desc = "Previous todo comment" })
+
+-- You can also specify a list of valid jump keywords
+
+vim.keymap.set("n", "]t", function()
+ require("todo-comments").jump_next({keywords = { "ERROR", "WARNING" }})
+end, { desc = "Next error/warning todo comment" })
+
+vim.keymap.set("n", "<leader>td", ":TodoTelescope")
--- /dev/null
+require("toggleterm").setup {
+ open_mapping = [[<c-t>]],
+ insert_mappings = true,
+ termina_mappings = true,
+ direction = "float"
+}
--- /dev/null
+require'nvim-treesitter.configs'.setup {
+ -- A list of parser names, or "all" (the five listed parsers should always be installed)
+ ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "python", "javascript", "typescript" },
+
+ -- Install parsers synchronously (only applied to `ensure_installed`)
+ sync_install = false,
+
+ -- Automatically install missing parsers when entering buffer
+ -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
+ auto_install = true,
+
+ -- List of parsers to ignore installing (for "all")
+ ignore_install = { "javascript" },
+
+ ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
+ -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
+
+ highlight = {
+ enable = true,
+
+ -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
+ -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
+ -- the name of the parser)
+ -- list of language that will be disabled
+ disable = { "c", "rust" },
+ -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
+ disable = function(lang, buf)
+ local max_filesize = 100 * 1024 -- 100 KB
+ local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+ if ok and stats and stats.size > max_filesize then
+ return true
+ end
+ end,
+
+ -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
+ -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
+ -- Using this option may slow down your editor, and you may see some duplicate highlights.
+ -- Instead of true it can also be a list of languages
+ additional_vim_regex_highlighting = false,
+ },
+}
--- /dev/null
+vim.keymap.set("n", "<leader>xx", function() require("trouble").open() end)
+vim.keymap.set("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end)
+vim.keymap.set("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end)
+vim.keymap.set("n", "<leader>xl", function() require("trouble").open("quickfix") end)
+vim.keymap.set("n", "<leader>xq", function() require("trouble").open("loclist") end)
+vim.keymap.set("n", "gR", function() require("trouble").open("lsp_references") end)
--- /dev/null
+vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
--- /dev/null
+require("yanky").setup({
+ highlight = {
+ on_put = true,
+ on_yank = true,
+ timer = 200,
+ },
+})
+require("telescope").load_extension("yank_history")
+