updated nvim config
This commit is contained in:
parent
b363111117
commit
ea34c67540
13 changed files with 92 additions and 124 deletions
4
.config/nvim/after/ftplugin/cmake.lua
Normal file
4
.config/nvim/after/ftplugin/cmake.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
1
.config/nvim/after/ftplugin/cpp.lua
Normal file
1
.config/nvim/after/ftplugin/cpp.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.opt_local.shiftwidth = 2
|
||||
6
.config/nvim/after/ftplugin/rst.lua
Normal file
6
.config/nvim/after/ftplugin/rst.lua
Normal 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
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
ColorMyPencils()
|
||||
14
.config/nvim/after/plugin/lualsp.lua
Normal file
14
.config/nvim/after/plugin/lualsp.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = {
|
||||
'vim',
|
||||
'require',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
2
.config/nvim/after/plugin/neotree.lua
Normal file
2
.config/nvim/after/plugin/neotree.lua
Normal 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>')
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
require('lennartalff.remap')
|
||||
require('lennartalff.set')
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme 'catppuccin-frappe'
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -19,14 +19,6 @@ vim.opt.smartindent = true
|
|||
|
||||
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', {
|
||||
pattern = 'Makefile',
|
||||
callback = function ()
|
||||
|
|
@ -38,16 +30,3 @@ vim.opt.scrolloff = 8
|
|||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.updatetime = 500
|
||||
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
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ return {
|
|||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
tag = 'v2.*',
|
||||
version = "v2.*",
|
||||
build = 'make install_jsregexp',
|
||||
},
|
||||
'lewis6991/gitsigns.nvim',
|
||||
|
|
@ -11,9 +11,15 @@ return {
|
|||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' } }
|
||||
},
|
||||
{ 'rose-pine/neovim', name = 'rose-pine' },
|
||||
{ 'catppuccin/nvim', name = 'catppuccin', priority = 1000 },
|
||||
{ 'tpope/vim-fugitive', name = 'fugitive' },
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
name = 'catppuccin',
|
||||
priority = 1000
|
||||
},
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
name = 'fugitive'
|
||||
},
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
dependencies = {
|
||||
|
|
@ -37,4 +43,7 @@ return {
|
|||
main = 'ibl',
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'jiangmiao/auto-pairs',
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,13 @@
|
|||
-- 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', {
|
||||
desc = 'LSP actions',
|
||||
callback = function(event)
|
||||
|
|
|
|||
18
.config/nvim/lua/plugins/neotree.lua
Normal file
18
.config/nvim/lua/plugins/neotree.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Reference in a new issue