config
This commit is contained in:
parent
49a2c15d1d
commit
af22c7ff32
12
init.lua
12
init.lua
|
@ -27,9 +27,10 @@ vim.g.maplocalleader = ' '
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = true
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
require 'custom.settings'
|
require 'custom.options'
|
||||||
require 'custom.keymaps'
|
require 'custom.keymaps'
|
||||||
require 'custom.basic-autocommands'
|
require 'custom.basic-autocommands'
|
||||||
|
require 'custom.macros'
|
||||||
|
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
|
@ -112,6 +113,7 @@ require('lazy').setup({
|
||||||
{ '<leader>s', group = '[S]earch' },
|
{ '<leader>s', group = '[S]earch' },
|
||||||
{ '<leader>w', group = '[W]save' },
|
{ '<leader>w', group = '[W]save' },
|
||||||
{ '<leader>t', group = '[T]oggle' },
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
|
{ '<leader>o', group = 'Harp[O]on' },
|
||||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -154,6 +156,11 @@ require('lazy').setup({
|
||||||
['<c-enter>'] = 'to_fuzzy_refine',
|
['<c-enter>'] = 'to_fuzzy_refine',
|
||||||
['<C-j>'] = 'move_selection_next',
|
['<C-j>'] = 'move_selection_next',
|
||||||
['<C-k>'] = 'move_selection_previous',
|
['<C-k>'] = 'move_selection_previous',
|
||||||
|
['<C-d>'] = 'delete_buffer',
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
['d'] = require('telescope.actions').delete_buffer,
|
||||||
|
['q'] = require('telescope.actions').close,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -202,7 +209,8 @@ require('lazy').setup({
|
||||||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
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>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>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
-- vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
vim.keymap.set('n', '<leader><leader>', '<cmd>Telescope buffers sort_mru=true sort_lastused=true theme=ivy<cr>', { desc = '[ ] Find existing buffers' })
|
||||||
|
|
||||||
-- It's also possible to pass additional configuration options.
|
-- It's also possible to pass additional configuration options.
|
||||||
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
-- [[ Basic Keymaps ]]
|
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
vim.keymap.set('n', '<leader>h', '<cmd>nohlsearch<CR>')
|
vim.keymap.set('n', '<leader>h', '<cmd>nohlsearch<CR>')
|
||||||
vim.keymap.set('i', 'jj', '<Esc>')
|
vim.keymap.set('i', 'jj', '<Esc>')
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- console.log("cursor: , cursor)
|
||||||
|
vim.fn.setreg('l', 'yiwoconsole.log("jjpa:" , jjpa);jj')
|
|
@ -37,7 +37,7 @@ vim.opt.smartcase = true
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.opt.signcolumn = 'yes'
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
vim.opt.updatetime = 250
|
vim.opt.updatetime = 50
|
||||||
|
|
||||||
-- Decrease mapped sequence wait time
|
-- Decrease mapped sequence wait time
|
||||||
vim.opt.timeoutlen = 300
|
vim.opt.timeoutlen = 300
|
||||||
|
@ -65,3 +65,25 @@ vim.opt.scrolloff = 10
|
||||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||||
-- See `:help 'confirm'`
|
-- See `:help 'confirm'`
|
||||||
vim.opt.confirm = true
|
vim.opt.confirm = true
|
||||||
|
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
-- set to 0 becouse of empty line
|
||||||
|
vim.opt.cmdheight = 0
|
||||||
|
|
||||||
|
-- set cmd height when entering command mode
|
||||||
|
vim.api.nvim_command 'autocmd CmdlineEnter * set cmdheight=1'
|
||||||
|
vim.api.nvim_command 'autocmd CmdlineLeave * set cmdheight=0'
|
||||||
|
vim.api.nvim_command 'autocmd RecordingEnter * set cmdheight=1'
|
||||||
|
vim.api.nvim_command 'autocmd RecordingLeave * set cmdheight=0'
|
||||||
|
|
||||||
|
-- auto resize screen
|
||||||
|
-- Create an autocommand group for auto resizing
|
||||||
|
vim.api.nvim_create_augroup('autoequalize', { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'VimEnter', 'VimResized' }, {
|
||||||
|
callback = function()
|
||||||
|
vim.cmd 'wincmd ='
|
||||||
|
end,
|
||||||
|
group = 'autoequalize',
|
||||||
|
})
|
|
@ -8,7 +8,7 @@ return {
|
||||||
provider = 'openai',
|
provider = 'openai',
|
||||||
openai = {
|
openai = {
|
||||||
endpoint = 'https://api.openai.com/v1',
|
endpoint = 'https://api.openai.com/v1',
|
||||||
model = 'gpt-4o-mini', -- your desired model (or use gpt-4o, etc.)
|
model = 'gpt-4o', -- your desired model (or use gpt-4o, etc.)
|
||||||
timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models
|
timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models
|
||||||
temperature = 0,
|
temperature = 0,
|
||||||
max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
|
max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
return {
|
||||||
|
'ThePrimeagen/harpoon',
|
||||||
|
branch = 'harpoon2',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
config = function()
|
||||||
|
local harpoon = require 'harpoon'
|
||||||
|
|
||||||
|
-- REQUIRED
|
||||||
|
harpoon:setup()
|
||||||
|
-- REQUIRED
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>oa', function()
|
||||||
|
harpoon:list():add()
|
||||||
|
end, { desc = 'Add File' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>oi', function()
|
||||||
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
|
end, { desc = 'Open L[I]st' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>1', function()
|
||||||
|
harpoon:list():select(1)
|
||||||
|
end, { desc = 'Select [1]' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>2', function()
|
||||||
|
harpoon:list():select(2)
|
||||||
|
end, { desc = 'Select [2]' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>3', function()
|
||||||
|
harpoon:list():select(3)
|
||||||
|
end, { desc = 'Select [3]' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>4', function()
|
||||||
|
harpoon:list():select(4)
|
||||||
|
end, { desc = 'Select [4]' })
|
||||||
|
|
||||||
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
|
vim.keymap.set('n', '<leader>oj', function()
|
||||||
|
harpoon:list():prev()
|
||||||
|
end, { desc = 'Previus File' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>ok', function()
|
||||||
|
harpoon:list():next()
|
||||||
|
end, { desc = 'Next File' })
|
||||||
|
end,
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ return {
|
||||||
},
|
},
|
||||||
-------------------------------------UTILS-------------------------------------
|
-------------------------------------UTILS-------------------------------------
|
||||||
require 'custom.plugins.avante',
|
require 'custom.plugins.avante',
|
||||||
|
-- i use this so i can comment in TS components etc
|
||||||
'JoosepAlviste/nvim-ts-context-commentstring',
|
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||||
{
|
{
|
||||||
'numToStr/Comment.nvim',
|
'numToStr/Comment.nvim',
|
||||||
|
@ -59,7 +60,7 @@ return {
|
||||||
'<leader>y',
|
'<leader>y',
|
||||||
mode = { 'n', 'v' },
|
mode = { 'n', 'v' },
|
||||||
'<cmd>Yazi<cr>',
|
'<cmd>Yazi<cr>',
|
||||||
desc = 'Open yazi at the current file',
|
desc = 'Open [Y]azi at the current file',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
|
Loading…
Reference in New Issue