aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2023-07-30 20:45:59 +0200
committerbozo.kopic <bozo@kopic.xyz>2023-07-30 20:45:59 +0200
commite9a8eb8621cc6a281b0373d12af52bf562d0fe8a (patch)
tree6011638ad1d253fdb9c838cebf1cfbf68d74691e /nvim
parentbdf9097b7e3af3eda9fbdb33c2d544ad4ea5a8f2 (diff)
.
Diffstat (limited to 'nvim')
-rw-r--r--nvim/init.lua50
1 files changed, 41 insertions, 9 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index d852fe8..e3b859a 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -51,9 +51,9 @@ vim.o.colorcolumn = "80"
vim.o.cursorline = true
-- set tab width and use spaces for tabs
-vim.o.tabstop = 4
-vim.o.shiftwidth = 4
-vim.o.softtabstop = 4
+vim.o.tabstop = 4
+vim.o.shiftwidth = 4
+vim.o.softtabstop = 4
vim.o.expandtab = true
-- disable netrw
@@ -88,6 +88,9 @@ vim.api.nvim_create_autocmd({"FileType"}, {
command = "set tabstop=4 shiftwidth=8 softtabstop=0 noexpandtab"
})
+-- trim whitespace
+vim.keymap.set('n', '<Leader>wt', [[:%s/\s\+$//e<cr>]])
+
-- reload vimrc on change
vim.api.nvim_create_augroup("reload_vimrc", {})
vim.api.nvim_create_autocmd({"BufWritePost"}, {
@@ -139,10 +142,10 @@ require('packer').startup {
use {
'tanvirtin/monokai.nvim',
config = function()
- require('monokai').setup({})
+ require('monokai').setup {}
end
}
-
+
use 'christoomey/vim-tmux-navigator'
-- use 'jiangmiao/auto-pairs'
@@ -155,7 +158,7 @@ require('packer').startup {
}
use 'mg979/vim-visual-multi'
-
+
use {
'nvim-tree/nvim-web-devicons',
config = function()
@@ -171,7 +174,7 @@ require('packer').startup {
'nvim-lua/plenary.nvim'
},
after = {
- 'nvim-web-devicons'
+ 'nvim-web-devicons'
},
config = function()
require("nvim-tree").setup {
@@ -206,7 +209,7 @@ require('packer').startup {
use {
'romgrk/barbar.nvim',
- after = {
+ after = {
'nvim-tree.lua',
'nvim-web-devicons'
},
@@ -257,7 +260,7 @@ require('packer').startup {
use {
'nvim-telescope/telescope.nvim',
- requires = {
+ requires = {
'BurntSushi/ripgrep',
'nvim-lua/plenary.nvim',
'cljoly/telescope-repo.nvim'
@@ -347,6 +350,35 @@ require('packer').startup {
end
}
+ use {
+ 'hrsh7th/nvim-cmp',
+ requires = {
+ 'hrsh7th/cmp-nvim-lsp',
+ 'hrsh7th/cmp-buffer',
+ 'hrsh7th/cmp-vsnip',
+ 'hrsh7th/vim-vsnip'
+ },
+ config = function()
+ local cmp = require('cmp')
+ cmp.setup {
+ snippet = {
+ expand = function (args)
+ vim.fn["vsnip#anonymous"](args.body)
+ end
+ },
+ mapping = cmp.mapping.preset.insert({
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.abort(),
+ ['<CR>'] = cmp.mapping.confirm({ select = true })
+ }),
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'buffer' }
+ })
+ }
+ end
+ }
+
if bootstrap_packer then
require('packer').sync()
end