Skip to content
Open
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
66 changes: 60 additions & 6 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,59 @@ require('lazy').setup({
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
},
config = function()
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event)
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself.
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local map = function(keys, func, desc)
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
end

-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')

-- Find references for the word under your cursor.
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')

-- Jump to the implementation of the word under your cursor.
-- Useful when your language has ways of declaring types without an actual implementation.
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')

-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')

-- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc.
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')

-- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')

-- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
map('<leader>lr', vim.lsp.buf.rename, '[R]e[n]ame')

-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map('<leader>la', vim.lsp.buf.code_action, '[C]ode [A]ction')

-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap.
map('K', vim.lsp.buf.hover, 'Hover Documentation')

-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map('gt', vim.lsp.buf.declaration, '[G]oto [T]ype Declaration')
end,
})
-- 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!
Expand Down Expand Up @@ -674,7 +727,7 @@ require('lazy').setup({
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local disable_filetypes = { c = true, cpp = true, md = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
Expand Down Expand Up @@ -871,11 +924,12 @@ require('lazy').setup({
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs',
require 'kickstart.plugins.neo-tree',
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
require 'custom.plugins.init',

-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
Expand Down
25 changes: 25 additions & 0 deletions lua/custom/plugins/catppuccin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
config = function()
require('catppuccin').setup {
flavour = 'mocha',
integrations = {
telescope = true,
treesitter = true,
cmp = true,
gitsigns = true,
},
custom_highlights = function(colors)
return {
LineNr = { fg = colors.mauve },
CursorLineNr = { fg = colors.lavender, bold = true },
Visual = { bg = colors.surface1 },
TelescopeSelection = { bg = colors.surface1 },
}
end,
}
vim.cmd.colorscheme 'catppuccin'
end,
}
1 change: 1 addition & 0 deletions lua/custom/plugins/firenvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return { 'glacambre/firenvim', build = ':call firenvim#install(0)' }
35 changes: 34 additions & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,37 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

vim.opt.number = true

vim.opt.relativenumber = true
vim.opt.wrap = false

vim.keymap.set('n', '<C-k>', '15k', { desc = 'Scroll up and center' })
vim.keymap.set('n', '<C-j>', '15j', { desc = 'Scroll down and center' })
vim.keymap.set('n', '<C-c>', 'ggVGy', { desc = 'Copy file' })
vim.keymap.set('n', '<leader>e', ':Neotree<CR>', { noremap = true, silent = true })
-- vim.keymap.set('n', '<leader>e', ':Explore<CR>', { desc = 'Open explorer' })

return {
{
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'sindrets/diffview.nvim',
'ibhagwan/fzf-lua',
},
config = function()
local neogit = require 'neogit'
vim.keymap.set('n', '<leader>gg', neogit.open, { desc = 'Open Neogit' })
neogit.setup {}
end,
},
{
'github/copilot.vim',
cmd = 'Copilot', -- Load Copilot only when the 'Copilot' command is invoked
event = 'InsertEnter', -- Load Copilot when entering insert mode
config = true, -- Automatically run the default setup
},
}
12 changes: 12 additions & 0 deletions lua/custom/plugins/lualline.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = false,
component_separators = '|',
section_separators = '',
},
},
}
9 changes: 9 additions & 0 deletions lua/custom/plugins/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
return {
'nvim-tree/nvim-tree.lua',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
require('nvim-tree').setup {}
end,
}
Loading