updated nvim config

This commit is contained in:
Thies Lennart Alff 2023-10-27 23:04:31 +02:00
parent b363111117
commit ea34c67540
13 changed files with 92 additions and 124 deletions

View file

@ -0,0 +1,4 @@
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true

View file

@ -0,0 +1 @@
vim.opt_local.shiftwidth = 2

View file

@ -0,0 +1,6 @@
vim.opt.wrap = true -- softwrap the text
vim.opt.linebreak = true -- do not break in the middle of words
vim.opt.tabstop = 3
vim.opt.softtabstop = 3
vim.opt.shiftwidth = 3
vim.opt.expandtab = true

View file

@ -1,6 +0,0 @@
function ColorMyPencils(color)
color = color or "rose-pine"
vim.cmd.colorscheme(color)
end
ColorMyPencils()

View file

@ -0,0 +1,14 @@
local lspconfig = require('lspconfig')
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = {
'vim',
'require',
},
},
},
},
})

View file

@ -0,0 +1,2 @@
vim.keymap.set('n', '<leader>nf', '<cmd>Neotree<cr>')
vim.keymap.set('n', '<leader>nb', '<cmd>Neotree source=buffers<cr>')

View file

@ -1,5 +1,4 @@
require('lennartalff.remap') require('lennartalff.remap')
require('lennartalff.set') require('lennartalff.set')
-- vim.cmd('colorscheme rose-pine')
vim.o.termguicolors = true vim.o.termguicolors = true
vim.cmd.colorscheme 'catppuccin-frappe' vim.cmd.colorscheme 'catppuccin-frappe'

View file

@ -1,65 +0,0 @@
-- packer bootstrapping
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use 'lewis6991/gitsigns.nvim'
use {
'nvim-telescope/telescope.nvim', tag = '0.1.1',
-- or , branch = '0.1.x',
requires = { { 'nvim-lua/plenary.nvim' } }
}
use({ 'rose-pine/neovim', as = 'rose-pine' })
use {
'nvim-treesitter/nvim-treesitter',
run = function()
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
end,
}
use 'tpope/vim-fugitive'
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
requires = {
-- LSP Support
{ 'neovim/nvim-lspconfig' }, -- Required
{ -- Optional
'williamboman/mason.nvim',
run = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
-- Autocompletion
{ 'hrsh7th/nvim-cmp' }, -- Required
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
{ 'L3MON4D3/LuaSnip' }, -- Required
{ 'mhartington/formatter.nvim' },
}
}
use {
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" }
}
}
if packer_bootstrap then
require('packer').sync()
end
end)

View file

@ -19,14 +19,6 @@ vim.opt.smartindent = true
vim.opt.wrap = false vim.opt.wrap = false
vim.api.nvim_create_autocmd("FileType", {
pattern = "cpp",
callback = function()
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
end
})
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
pattern = 'Makefile', pattern = 'Makefile',
callback = function () callback = function ()
@ -38,16 +30,3 @@ vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes' vim.opt.signcolumn = 'yes'
vim.opt.updatetime = 500 vim.opt.updatetime = 500
vim.opt.colorcolumn = '80' vim.opt.colorcolumn = '80'
vim.api.nvim_create_autocmd('FileType', {
pattern = 'rst',
callback = function()
vim.opt.wrap = true -- softwrap the text
vim.opt.linebreak = true -- do not break in the middle of words
-- rst uses 3 space indents
vim.opt.tabstop = 3
vim.opt.softtabstop = 3
vim.opt.shiftwidth = 3
vim.opt.expandtab = true
end
})

View file

@ -2,7 +2,7 @@ return {
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }, { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
{ {
'L3MON4D3/LuaSnip', 'L3MON4D3/LuaSnip',
tag = 'v2.*', version = "v2.*",
build = 'make install_jsregexp', build = 'make install_jsregexp',
}, },
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
@ -11,9 +11,15 @@ return {
dependencies = { dependencies = {
{ 'nvim-lua/plenary.nvim' } } { 'nvim-lua/plenary.nvim' } }
}, },
{ 'rose-pine/neovim', name = 'rose-pine' }, {
{ 'catppuccin/nvim', name = 'catppuccin', priority = 1000 }, 'catppuccin/nvim',
{ 'tpope/vim-fugitive', name = 'fugitive' }, name = 'catppuccin',
priority = 1000
},
{
'tpope/vim-fugitive',
name = 'fugitive'
},
{ {
'ThePrimeagen/harpoon', 'ThePrimeagen/harpoon',
dependencies = { dependencies = {
@ -37,4 +43,7 @@ return {
main = 'ibl', main = 'ibl',
opts = {}, opts = {},
}, },
{
'jiangmiao/auto-pairs',
},
} }

View file

@ -7,6 +7,13 @@
-- require('cmp_nvim_lsp').default_capabilities() -- require('cmp_nvim_lsp').default_capabilities()
--) --)
vim.api.nvim_create_autocmd('FileType', {
pattern = 'tex',
callback = function()
require('cmp').setup.buffer { sources = {{ name = 'omni' }} }
end,
})
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions', desc = 'LSP actions',
callback = function(event) callback = function(event)

View file

@ -0,0 +1,18 @@
return {
{
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
opts = {
filesystem = {
follow_current_file = {
enabled = true,
},
}
},
},
}