first personalization

This commit is contained in:
Florian Feigl 2024-01-12 21:22:07 +01:00
parent 2510c29d62
commit 28778716da
6 changed files with 38 additions and 130 deletions

View File

@ -1,24 +0,0 @@
================================================================================
INTRODUCTION *kickstart.nvim*
Kickstart.nvim is a project to help you get started on your neovim journey.
*kickstart-is-not*
It is not:
- Complete framework for every plugin under the sun
- Place to add every plugin that could ever be useful
*kickstart-is*
It is:
- Somewhere that has a good start for the most common "IDE" type features:
- autocompletion
- goto-definition
- find references
- fuzzy finding
- and hinting at what more can be done :)
- A place to _kickstart_ your journey.
- You should fork this project and use/modify it so that it matches your
style and preferences. If you don't want to do that, there are probably
other projects that would fit much better for you (and that's great!)!
vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,3 +0,0 @@
kickstart-is kickstart.txt /*kickstart-is*
kickstart-is-not kickstart.txt /*kickstart-is-not*
kickstart.nvim kickstart.txt /*kickstart.nvim*

114
init.lua
View File

@ -1,52 +1,8 @@
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Kickstart.nvim is *not* a distribution.
Kickstart.nvim is a template for your own configuration.
The goal is that you can read every line of code, top-to-bottom, understand
what your configuration is doing, and modify it to suit your needs.
Once you've done that, you should start exploring, configuring and tinkering to
explore Neovim!
If you don't know anything about Lua, I recommend taking some time to read through
a guide. One possible example:
- https://learnxinyminutes.com/docs/lua/
And then you can explore or search through `:help lua-guide`
- https://neovim.io/doc/user/lua-guide.html
Kickstart Guide:
I have left several `:help X` comments throughout the init.lua
You should run that command and read that help section for more information.
In addition, I have some `NOTE:` items throughout the file.
These are for you, the reader to help understand what is happening. Feel free to delete
them once you know what you're doing, but they should serve as a guide for when you
are first encountering a few different constructs in your nvim config.
I hope you enjoy your Neovim journey,
- TJ
P.S. You can delete this when you're done too. It's your config now :)
--]]
-- Set <space> as the leader key -- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- [[ Install `lazy.nvim` plugin manager ]] -- [[ Install `lazy.nvim` plugin manager ]]
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system { vim.fn.system {
@ -61,13 +17,7 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- [[ Configure plugins ]] -- [[ Configure plugins ]]
-- NOTE: Here is where you install your plugins.
-- You can configure plugins using the `config` key.
--
-- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime.
require('lazy').setup({ require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration
-- Git related plugins -- Git related plugins
'tpope/vim-fugitive', 'tpope/vim-fugitive',
@ -75,9 +25,6 @@ require('lazy').setup({
-- Detect tabstop and shiftwidth automatically -- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth', 'tpope/vim-sleuth',
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{ {
-- LSP Configuration & Plugins -- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
@ -87,8 +34,7 @@ require('lazy').setup({
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP -- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} },
{ 'j-hui/fidget.nvim', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing! -- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim', 'folke/neodev.nvim',
@ -113,7 +59,7 @@ require('lazy').setup({
}, },
-- Useful plugin to show you pending keybinds. -- 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 -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
@ -194,6 +140,10 @@ require('lazy').setup({
'navarasu/onedark.nvim', 'navarasu/onedark.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
require("onedark").setup {
style = "warm"
}
require("onedark").load()
vim.cmd.colorscheme 'onedark' vim.cmd.colorscheme 'onedark'
end, end,
}, },
@ -216,7 +166,6 @@ require('lazy').setup({
-- Add indentation guides even on blank lines -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim` -- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl', main = 'ibl',
opts = {}, opts = {},
}, },
@ -224,19 +173,13 @@ require('lazy').setup({
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
branch = '0.1.x', branch = '0.1.x',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{ {
'nvim-telescope/telescope-fzf-native.nvim', 'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make', build = 'make',
cond = function() cond = function()
return vim.fn.executable 'make' == 1 return vim.fn.executable 'make' == 1
@ -254,25 +197,13 @@ require('lazy').setup({
build = ':TSUpdate', build = ':TSUpdate',
}, },
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart require 'kickstart.plugins.autoformat',
-- These are some example plugins that I've included in the kickstart repository. require 'kickstart.plugins.debug',
-- Uncomment any of the lines below to enable them.
-- 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` { import = 'custom.plugins' },
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
-- { import = 'custom.plugins' },
}, {}) }, {})
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- Set highlight on search -- Set highlight on search
vim.o.hlsearch = false vim.o.hlsearch = false
@ -283,8 +214,6 @@ vim.wo.number = true
vim.o.mouse = 'a' vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim. -- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus' vim.o.clipboard = 'unnamedplus'
-- Enable break indent -- Enable break indent
@ -419,14 +348,13 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
-- [[ Configure Treesitter ]] -- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter` -- See `:help nvim-treesitter`
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
vim.defer_fn(function() vim.defer_fn(function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, 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!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = true,
-- Install languages synchronously (only applied to `ensure_installed`) -- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
-- List of parsers to ignore installing -- List of parsers to ignore installing
@ -494,10 +422,6 @@ end, 0)
-- [[ Configure LSP ]] -- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
-- 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
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific -- 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. -- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc) local nmap = function(keys, func, desc)
@ -547,8 +471,7 @@ require('which-key').register {
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
} }
-- register which-key VISUAL mode
-- required for visual <leader>hs (hunk stage) to work
require('which-key').register({ require('which-key').register({
['<leader>'] = { name = 'VISUAL <leader>' }, ['<leader>'] = { name = 'VISUAL <leader>' },
['<leader>h'] = { 'Git [H]unk' }, ['<leader>h'] = { 'Git [H]unk' },
@ -561,19 +484,14 @@ require('mason-lspconfig').setup()
-- Enable the following language servers -- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
--
-- 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 = { local servers = {
-- clangd = {}, clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, rust_analyzer = {},
-- tsserver = {}, -- tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} }, html = { filetypes = { 'html', 'twig', 'hbs' } },
lua_ls = { lua_ls = {
Lua = { Lua = {

View File

@ -1,5 +0,0 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}

View File

@ -0,0 +1,16 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
"3rd/image.nvim",
},
keys = {
{ "<leader>ft", "<cmd>Neotree reveal left<cr>", desc = "NeoTree" },
-- config = function()
-- require("neo-tree").setup()
-- end,
}
}

View File

@ -0,0 +1,6 @@
return {
vim.cmd("set expandtab"),
vim.cmd("set tabstop=2"),
vim.cmd("set softtabstop=2"),
vim.cmd("set shiftwidth=2"),
}