Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357vim.keymap.set('i', 'kj', '<ESC>')vim.keymap.set('n', ';', ':')
vim.opt.clipboard = 'unnamed'vim.schedule(function() vim.opt.clipboard = 'unnamedplus'end)
vim.opt.wrap = falsevim.opt.tabstop = 4vim.opt.shiftwidth = 4vim.opt.softtabstop = 4vim.opt.expandtab = truevim.opt.termguicolors = true
-- This clears the background color of nvim-- vim.cmd [[-- highlight Normal guibg=none-- highlight NonText guibg=none-- highlight Normal ctermbg=none-- highlight NonText ctermbg=none-- ]]
-- Set <space> as the leader key-- See `:help mapleader`-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)vim.g.mapleader = ' 'vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminalvim.g.have_nerd_font = true
-- [[ Setting options ]]-- See `:help vim.opt`-- NOTE: You can change these options as you wish!-- For more options, you can see `:help option-list`
-- Make line numbers defaultvim.opt.number = true-- You can also add relative line numbers, to help with jumping.-- Experiment for yourself to see if you like it!vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!vim.opt.mouse = 'a'
-- Don't show the mode, since it's already in the status linevim.opt.showmode = false
-- Sync clipboard between OS and Neovim.-- Schedule the setting after `UiEnter` because it can increase startup-time.-- Remove this option if you want your OS clipboard to remain independent.-- See `:help 'clipboard'`vim.schedule(function() vim.opt.clipboard = 'unnamedplus'end)
-- Enable break indentvim.opt.breakindent = true
-- Save undo historyvim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search termvim.opt.ignorecase = truevim.opt.smartcase = true
-- Keep signcolumn on by defaultvim.opt.signcolumn = 'yes'
-- Decrease update timevim.opt.updatetime = 250
-- Decrease mapped sequence wait time-- Displays which-key popup soonervim.opt.timeoutlen = 300
-- Configure how new splits should be openedvim.opt.splitright = truevim.opt.splitbelow = true
-- Sets how neovim will display certain whitespace characters in the editor.-- See `:help 'list'`-- and `:help 'listchars'`vim.opt.list = truevim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- Preview substitutions live, as you type!vim.opt.inccommand = 'split'
-- Show which line your cursor is onvim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.vim.opt.scrolloff = 5
-- [[ Basic Autocommands ]]-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text-- Try it with `yap` in normal mode-- See `:help vim.highlight.on_yank()`vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() vim.highlight.on_yank() end,})
-- [[ Install `lazy.nvim` plugin manager ]]-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more infolocal lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'if not vim.uv.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) endend ---@diagnostic disable-next-line: undefined-fieldvim.opt.rtp:prepend(lazypath)
require('lazy').setup({ 'brenoprata10/nvim-highlight-colors', { 'ThePrimeagen/harpoon', branch = 'harpoon2', dependencies = { 'nvim-lua/plenary.nvim' }, }, { 'sphamba/smear-cursor.nvim', opts = {}, }, { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', event = 'VimEnter', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', { -- If encountering errors, see telescope-fzf-native README for installation instructions 'nvim-telescope/telescope-fzf-native.nvim',
-- `build` is used to run some command when the plugin is installed/updated. -- This is only run then, not every time Neovim starts up. build = 'make',
-- `cond` is a condition used to determine whether this plugin should be -- installed and loaded. cond = function() return vim.fn.executable 'make' == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' },
-- Useful for getting pretty icons, but requires a Nerd Font. { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that -- it can fuzzy find! It's more than just a "file finder", it can search -- many different aspects of Neovim, your workspace, LSP, and more! -- -- The easiest way to use Telescope, is to start by doing something like: -- :Telescope help_tags -- -- After running this command, a window will open up and you're able to -- type in the prompt window. You'll see a list of `help_tags` options and -- a corresponding preview of the help. -- -- Two important keymaps to use while in Telescope are: -- - Insert mode: <c-/> -- - Normal mode: ? -- -- This opens a window that shows you all of the keymaps for the current -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it!
-- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- -- defaults = { -- mappings = { -- i = { ['<c-enter>'] = 'to_fuzzy_refine' }, -- }, -- }, -- pickers = {} extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), }, }, }
-- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select')
-- See `:help telescope.builtin` local builtin = require 'telescope.builtin' vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '<leader>/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' })
-- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', '<leader>s/', function() builtin.live_grep { grep_open_files = true, prompt_title = 'Live Grep in Open Files', } end, { desc = '[S]earch [/] in Open Files' })
-- Shortcut for searching your Neovim configuration files vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) end, }, { -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. 'folke/tokyonight.nvim', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- vim.cmd.colorscheme 'tokyonight-night' -- vim.cmd.colorscheme 'habamax' -- vim.cmd.colorscheme 'rose-pine' -- vim.cmd.colorscheme 'cyberdream' -- vim.cmd.colorscheme 'melange' vim.cmd.colorscheme 'retrobox' -- vim.cmd.colorscheme 'tokyonight-day' -- vim.cmd.colorscheme 'tokyonight-storm' -- vim.cmd.colorscheme 'tokyonight-moon'
-- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' end, }, -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },}, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table icons = vim.g.have_nerd_font and {} or { cmd = '⌘', config = '🛠', event = '📅', ft = '📂', init = '⚙', keys = '🗝', plugin = '🔌', runtime = '💻', require = '🌙', source = '📄', start = '🚀', task = '📌', lazy = '💤 ', }, },})
require('nvim-highlight-colors').setup { render = 'virtual',}local harpoon = require 'harpoon'
-- REQUIREDharpoon:setup()-- REQUIRED
vim.keymap.set('n', '<leader>a', function() harpoon:list():add()end)vim.keymap.set('n', '<C-h>', function() harpoon.ui:toggle_quick_menu(harpoon:list())end)
vim.keymap.set('n', '<C-1>', function() harpoon:list():select(1)end)vim.keymap.set('n', '<C-2>', function() harpoon:list():select(2)end)vim.keymap.set('n', '<C-3>', function() harpoon:list():select(3)end)vim.keymap.set('n', '<C-4>', function() harpoon:list():select(4)end)
-- Toggle previous & next buffers stored within Harpoon listvim.keymap.set('n', '<C-S-P>', function() harpoon:list():prev()end)vim.keymap.set('n', '<C-S-N>', function() harpoon:list():next()end)
local harpoon = require 'harpoon'harpoon:setup {}
-- basic telescope configurationlocal conf = require('telescope.config').valueslocal function toggle_telescope(harpoon_files) local file_paths = {} for _, item in ipairs(harpoon_files.items) do table.insert(file_paths, item.value) end
require('telescope.pickers') .new({}, { prompt_title = 'Harpoon', finder = require('telescope.finders').new_table { results = file_paths, }, previewer = conf.file_previewer {}, sorter = conf.generic_sorter {}, }) :find()end
vim.keymap.set('n', '<C-e>', function() toggle_telescope(harpoon:list())end, { desc = 'Open harpoon window' })