Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 89 additions & 25 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.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
vim.opt.relativenumber = true

-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
Expand Down Expand Up @@ -157,9 +157,46 @@ vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10

-- Tab size
-- Set global default tab size (optional)
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

-- Filetype-specific settings
vim.api.nvim_create_autocmd('FileType', {
pattern = 'c',
callback = function()
vim.opt_local.tabstop = 8
vim.opt_local.shiftwidth = 8
vim.opt_local.expandtab = true
end,
})

vim.api.nvim_create_autocmd('FileType', {
pattern = 'javascript',
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.expandtab = true
end,
})

vim.api.nvim_create_autocmd('FileType', {
pattern = 'jsx',
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.expandtab = true
end,
})

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`

-- Change the default file explorer command to leader + e

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake, was updading my personal config forked from this one with claude code, it proposed a pull request on the original repo instead of my own fork, noticed too late. Apologies!

vim.api.nvim_set_keymap('n', '<leader>pv', ':Ex<CR>', { noremap = true, silent = true })

-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
Expand All @@ -175,24 +212,38 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })

-- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Disable arrow keys in normal mode
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')

-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
-- See `:help wincmd` for a list of all window commands
-- Unmap Ctrl+L from clearing the screen
vim.keymap.set('n', '<C-l>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- Same keymaps for terminal mode
vim.keymap.set('t', '<C-h>', [[<C-\><C-n><C-h>]], { desc = 'Move out of terminal mode and focus to the left window' })
vim.keymap.set('t', '<C-l>', [[<C-\><C-n><C-l>]], { desc = 'Move out of terminal mode and focus to the right window' })
vim.keymap.set('t', '<C-j>', [[<C-\><C-n><C-j>]], { desc = 'Move out of terminal mode and focus to the lower window' })
vim.keymap.set('t', '<C-k>', [[<C-\><C-n><C-k>]], { desc = 'Move out of terminal mode and focus to the upper window' })

-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`

-- Disable auto-commenting on new lines for all file types
vim.api.nvim_create_autocmd('FileType', {
pattern = '*',
callback = function()
vim.bo.formatoptions = vim.bo.formatoptions:gsub('c', ''):gsub('r', '')
end,
})

-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
Expand Down Expand Up @@ -615,9 +666,9 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
clangd = {},
gopls = {},
pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
Expand Down Expand Up @@ -834,21 +885,19 @@ require('lazy').setup({
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'

-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
{
'metalelf0/black-metal-theme-neovim',
lazy = false, -- Load early to ensure colorscheme is available
priority = 1000, -- High priority for colorschemes
config = function()
require('black-metal').setup {
theme = 'taake', -- Set Taake as the default theme
variant = 'dark', -- Use the dark variant (default)
alt_bg = false, -- Set to true for marduk-alt (lighter background)
transparent = true, -- For transparent background (like tokyonight)
}
-- Load the colorscheme after setup
vim.cmd.colorscheme 'taake'
end,
},

Expand Down Expand Up @@ -918,6 +967,21 @@ require('lazy').setup({
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
},

--[[
{ -- Integrated Github Copilot
'github/copilot.vim',
cmd = 'Copilot',
event = 'InsertEnter',
build = ':Copilot auth',
config = function()
vim.g.copilot_no_tab_map = true
vim.g.copilot_no_y_map = true
vim.api.nvim_set_keymap('i', '<C-J>', 'copilot#Accept("<CR>")', { silent = true, expr = true })
end,
},
]]
--

-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and
-- place them in the correct locations.
Expand Down
1 change: 1 addition & 0 deletions pack/github/start/copilot.vim
Submodule copilot.vim added at 870381
Loading