Added my initial changes to kickstart.nvim.

This commit is contained in:
Simo Soini 2023-12-12 14:58:31 +02:00
parent 76c5b1ec57
commit f7a2b45abe
1 changed files with 55 additions and 13 deletions

View File

@ -69,6 +69,18 @@ vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration
-- Navigation integration for tmux
'christoomey/vim-tmux-navigator',
-- Undotree for saving file editing history
'mbbill/undotree',
-- Automatic pairs for parentheses etc.
'jiangmiao/auto-pairs',
-- Github copilot
'github/copilot.vim',
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
@ -76,6 +88,23 @@ require('lazy').setup({
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
-- Harpoon for fast navigation within a project
{
'theprimeagen/harpoon',
config = function()
local mark = require('harpoon.mark')
local ui = require('harpoon.ui')
vim.keymap.set('n', '<leader>a', mark.add_file)
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu)
vim.keymap.set('n', '<C-t>', function() ui.nav_file(1) end)
vim.keymap.set('n', '<C-n>', function() ui.nav_file(2) end)
vim.keymap.set('n', '<C-s>', function() ui.nav_file(3) end)
end
},
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{
@ -113,7 +142,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -190,11 +219,11 @@ require('lazy').setup({
},
{
-- Theme inspired by Atom
'navarasu/onedark.nvim',
-- Theme
'nyoom-engineering/oxocarbon.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
vim.cmd.colorscheme 'oxocarbon'
end,
},
@ -205,9 +234,9 @@ require('lazy').setup({
opts = {
options = {
icons_enabled = false,
theme = 'onedark',
component_separators = '|',
section_separators = '',
theme = 'oxocarbon',
-- component_separators = '|',
-- section_separators = '',
},
},
},
@ -257,7 +286,7 @@ require('lazy').setup({
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat',
require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
@ -273,11 +302,15 @@ require('lazy').setup({
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- Enable scrolloff
vim.opt.scrolloff = 8
-- Set highlight on search
vim.o.hlsearch = false
-- Make line numbers default
-- Enable relative linenumbers
vim.wo.number = true
vim.opt.relativenumber = true
-- Enable mouse mode
vim.o.mouse = 'a'
@ -326,6 +359,14 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- Move highlighted lines up and down
vim.keymap.set('v', 'J', ':m ">+1<CR>gv=gv')
vim.keymap.set('v', 'K', ':m ">-2<CR>gv=gv')
-- Center search results
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
@ -426,7 +467,8 @@ vim.defer_fn(function()
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
auto_install = true,
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
@ -563,12 +605,12 @@ require('mason-lspconfig').setup()
-- If you want to override the default filetypes that your language server will attach to you can
-- define the property 'filetypes' to the map in question.
local servers = {
-- clangd = {},
clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
rust_analyzer = {},
-- tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
-- html = { filetypes = { 'html', 'twig', 'hbs' } },
lua_ls = {
Lua = {