Skip to content

Commit aaf1294

Browse files
authored
Merge pull request #1 from willchertoff/personalize
first thing
2 parents 3338d39 + 0285996 commit aaf1294

File tree

3 files changed

+157
-14
lines changed

3 files changed

+157
-14
lines changed

init.lua

Lines changed: 67 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ P.S. You can delete this when you're done too. It's your config now! :)
8787
-- Set <space> as the leader key
8888
-- See `:help mapleader`
8989
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
90-
vim.g.mapleader = ' '
90+
vim.g.mapleader = ','
9191
vim.g.maplocalleader = ' '
9292

9393
-- Set to true if you have a Nerd Font installed and selected in the terminal
@@ -407,11 +407,15 @@ require('lazy').setup({
407407
-- You can put your default mappings / updates / etc. in here
408408
-- All the info you're looking for is in `:help telescope.setup()`
409409
--
410-
-- defaults = {
411-
-- mappings = {
412-
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
413-
-- },
414-
-- },
410+
defaults = {
411+
mappings = {
412+
i = {
413+
['<c-enter>'] = 'to_fuzzy_refine',
414+
['<C-j>'] = require('telescope.actions').move_selection_next,
415+
['<C-k>'] = require('telescope.actions').move_selection_previous,
416+
},
417+
},
418+
},
415419
-- pickers = {}
416420
extensions = {
417421
['ui-select'] = {
@@ -428,13 +432,13 @@ require('lazy').setup({
428432
local builtin = require 'telescope.builtin'
429433
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
430434
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
431-
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
435+
vim.keymap.set('n', '<leader>tt', builtin.find_files, { desc = '[S]earch [F]iles' })
432436
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
433437
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
434438
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
435439
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
436440
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
437-
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
441+
vim.keymap.set('n', '<leader>;', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
438442
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
439443

440444
-- Slightly advanced example of overriding default behavior and theme
@@ -553,7 +557,7 @@ require('lazy').setup({
553557
-- Jump to the definition of the word under your cursor.
554558
-- This is where a variable was first declared, or where a function is defined, etc.
555559
-- To jump back, press <C-t>.
556-
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
560+
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
557561

558562
-- WARN: This is not Goto Definition, this is Goto Declaration.
559563
-- For example, in C this would take you to the header.
@@ -673,15 +677,52 @@ require('lazy').setup({
673677
local servers = {
674678
-- clangd = {},
675679
-- gopls = {},
676-
-- pyright = {},
680+
pyright = {},
677681
-- rust_analyzer = {},
678682
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
679683
--
680684
-- Some languages (like typescript) have entire language plugins that can be useful:
681685
-- https://github.com/pmizio/typescript-tools.nvim
682686
--
683687
-- But for many setups, the LSP (`ts_ls`) will work just fine
684-
-- ts_ls = {},
688+
ts_ls = {
689+
cmd = { 'typescript-language-server', '--stdio', '--max_old_space_size=16384' },
690+
init_options = {
691+
maxTsServerMemory = 16384,
692+
preferences = {
693+
disableSuggestions = false,
694+
includeCompletionsForModuleExports = true,
695+
includeCompletionsWithInsertText = true,
696+
},
697+
tsserver = {
698+
maxTsServerMemory = 16384,
699+
},
700+
},
701+
settings = {
702+
typescript = {
703+
inlayHints = {
704+
includeInlayParameterNameHints = 'all',
705+
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
706+
includeInlayFunctionParameterTypeHints = true,
707+
includeInlayVariableTypeHints = true,
708+
includeInlayPropertyDeclarationTypeHints = true,
709+
includeInlayFunctionLikeReturnTypeHints = true,
710+
includeInlayEnumMemberValueHints = true,
711+
},
712+
},
713+
javascript = {
714+
inlayHints = {
715+
includeInlayParameterNameHints = 'all',
716+
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
717+
includeInlayFunctionParameterTypeHints = true,
718+
includeInlayVariableTypeHints = true,
719+
includeInlayPropertyDeclarationTypeHints = true,
720+
includeInlayFunctionLikeReturnTypeHints = true,
721+
includeInlayEnumMemberValueHints = true,
722+
},
723+
},
724+
},
725+
},
685726
--
686727

687728
lua_ls = {
@@ -769,10 +810,11 @@ require('lazy').setup({
769810
formatters_by_ft = {
770811
lua = { 'stylua' },
771812
-- Conform can also run multiple formatters sequentially
772-
-- python = { "isort", "black" },
813+
python = { 'isort', 'black' },
773814
--
774815
-- You can use 'stop_after_first' to run the first available formatter from the list
775-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
816+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
817+
typescript = { 'prettierd', 'prettier', stop_after_first = true },
776818
},
777819
},
778820
},
@@ -944,7 +986,7 @@ require('lazy').setup({
944986
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
945987
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
946988
opts = {
947-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
989+
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'python' },
948990
-- Autoinstall languages that are not installed
949991
auto_install = true,
950992
highlight = {
@@ -979,6 +1021,8 @@ require('lazy').setup({
9791021
-- require 'kickstart.plugins.autopairs',
9801022
-- require 'kickstart.plugins.neo-tree',
9811023
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
1024+
require 'custom.plugins.oil',
1025+
require 'custom.plugins.avante',
9821026

9831027
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
9841028
-- This is the easiest way to modularize your config.
@@ -1014,3 +1058,12 @@ require('lazy').setup({
10141058

10151059
-- The line beneath this is called `modeline`. See `:help modeline`
10161060
-- vim: ts=2 sts=2 sw=2 et
1061+
1062+
-- SKYSTAR
1063+
--
1064+
require('oil').setup()
1065+
1066+
vim.keymap.set('i', 'jj', '<Esc>')
1067+
vim.keymap.set('n', '<leader>w', ':w<CR>')
1068+
vim.keymap.set('n', '<leader>n', ':enew<CR>')
1069+
vim.keymap.set('n', '<leader>pv', ':Oil<CR>')

lua/custom/plugins/avante.lua

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
return {
2+
{
3+
'yetone/avante.nvim',
4+
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
5+
-- ⚠️ must add this setting! ! !
6+
build = vim.fn.has 'win32' ~= 0 and 'powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false' or 'make',
7+
event = 'VeryLazy',
8+
version = false, -- Never set this value to "*"! Never!
9+
---@module 'avante'
10+
---@type avante.Config
11+
opts = {
12+
-- add any opts here
13+
-- this file can contain specific instructions for your project
14+
instructions_file = 'avante.md',
15+
-- for example
16+
provider = 'claude',
17+
providers = {
18+
claude = {
19+
endpoint = 'https://api.anthropic.com',
20+
model = 'claude-sonnet-4-20250514',
21+
timeout = 30000, -- Timeout in milliseconds
22+
extra_request_body = {
23+
temperature = 0.75,
24+
max_tokens = 20480,
25+
},
26+
},
27+
moonshot = {
28+
endpoint = 'https://api.moonshot.ai/v1',
29+
model = 'kimi-k2-0711-preview',
30+
timeout = 30000, -- Timeout in milliseconds
31+
extra_request_body = {
32+
temperature = 0.75,
33+
max_tokens = 32768,
34+
},
35+
},
36+
},
37+
},
38+
dependencies = {
39+
'nvim-lua/plenary.nvim',
40+
'MunifTanjim/nui.nvim',
41+
--- The below dependencies are optional,
42+
'nvim-mini/mini.pick', -- for file_selector provider mini.pick
43+
'nvim-telescope/telescope.nvim', -- for file_selector provider telescope
44+
'hrsh7th/nvim-cmp', -- autocompletion for avante commands and mentions
45+
'ibhagwan/fzf-lua', -- for file_selector provider fzf
46+
'stevearc/dressing.nvim', -- for input provider dressing
47+
'folke/snacks.nvim', -- for input provider snacks
48+
'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons
49+
'zbirenbaum/copilot.lua', -- for providers='copilot'
50+
{
51+
-- support for image pasting
52+
'HakonHarnes/img-clip.nvim',
53+
event = 'VeryLazy',
54+
opts = {
55+
-- recommended settings
56+
default = {
57+
embed_image_as_base64 = false,
58+
prompt_for_file_name = false,
59+
drag_and_drop = {
60+
insert_mode = true,
61+
},
62+
-- required for Windows users
63+
use_absolute_path = true,
64+
},
65+
},
66+
},
67+
{
68+
-- Make sure to set this up properly if you have lazy=true
69+
'MeanderingProgrammer/render-markdown.nvim',
70+
opts = {
71+
file_types = { 'markdown', 'Avante' },
72+
},
73+
ft = { 'markdown', 'Avante' },
74+
},
75+
},
76+
},
77+
}

lua/custom/plugins/oil.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
return {
2+
{
3+
'stevearc/oil.nvim',
4+
---@module 'oil'
5+
---@type oil.SetupOpts
6+
opts = {},
7+
-- Optional dependencies
8+
dependencies = { { 'nvim-mini/mini.icons', opts = {} } },
9+
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
10+
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
11+
lazy = false,
12+
},
13+
}

0 commit comments

Comments
 (0)