Move to packer, now fully lua

main
Steffen Rademacker 2 years ago
parent db13e00c47
commit fdac908cfd

2
.gitignore vendored

@ -1,7 +1,7 @@
karabiner/automatic_backups/* karabiner/automatic_backups/*
lazygit/state.yml lazygit/state.yml
nvim/.netrwhist nvim/.netrwhist
nvim/autoload/plug.vim.old nvim/plugin/*
office/mutt/cache/* office/mutt/cache/*
office/mutt/tmp/* office/mutt/tmp/*
office/vdirsyncer/status/* office/vdirsyncer/status/*

File diff suppressed because it is too large Load Diff

@ -0,0 +1,4 @@
require('plugins')
require('mappings')
require('options')
require('autocommands')

@ -1,48 +0,0 @@
call plug#begin('~/.config/nvim/plugged')
" Dependencies for other plugins
Plug 'rktjmp/lush.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'vijaymarupudi/nvim-fzf'
" Colorscheme
Plug 'ellisonleao/gruvbox.nvim'
" Plugins
Plug 'andersevenrud/cmp-tmux'
Plug 'christoomey/vim-tmux-navigator'
Plug 'editorconfig/editorconfig-vim'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-calc'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/vim-vsnip'
Plug 'ibhagwan/fzf-lua'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
Plug 'phaazon/hop.nvim'
Plug 'rafamadriz/friendly-snippets'
Plug 'tpope/vim-apathy'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'voldikss/vim-floaterm'
Plug 'wellle/targets.vim'
Plug 'wincent/terminus'
Plug 'windwp/nvim-autopairs'
call plug#end()
" load the default config and mappings
lua << EOF
require('plugins')
require('mappings')
require('options')
require('autocommands')
EOF

@ -0,0 +1 @@
require('nvim-autopairs').setup({})

@ -0,0 +1,44 @@
local cmp = require('cmp')
cmp.setup({
completion = {
keyword_length = 1, -- TODO set this back 3, when fine with snippets
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<cr>'] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{
name = 'buffer',
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end
},
},
{ name = 'path' },
{ name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy
{ name = 'calc' },
}),
formatting = {
format = function(entry, vim_item)
vim_item.menu = ({
buffer = "[Buffer]",
calc = "[Calc]",
nvim_lsp = "[LSP]",
path = "[Path]",
tmux = "[tmux]",
vsnip = "[Snippet]",
})[entry.source.name]
return vim_item
end
},
})

@ -0,0 +1,10 @@
local cmd = vim.cmd
local g = vim.g
g.floaterm_width = 0.8
g.floaterm_height = 0.8
g.floaterm_autoclose = 1
g.floaterm_opener = 'edit'
g.floaterm_borderchars = '─│─│╭╮╯╰'
g.floaterm_title = ''
cmd("au VimEnter * highlight FloatermBorder guibg='#282828' guifg='#fbf1c7'")

@ -0,0 +1,8 @@
require('fzf-lua').setup({
winopts = {
width = 0.80,
height = 0.78,
row = 0.45,
col = 0.48,
},
})

@ -0,0 +1 @@
require('hop').setup({})

@ -0,0 +1,25 @@
local lspconfig = require('lspconfig')
lspconfig.cssls.setup({
filetypes = { 'css', 'sass', 'scss' },
settings = {
css = {
validate = false,
},
scss = {
validate = false,
},
sass = {
validate = false,
},
},
})
lspconfig.eslint.setup({})
lspconfig.html.setup({})
lspconfig.jsonls.setup({})
lspconfig.phpactor.setup({})
lspconfig.stylelint_lsp.setup({
filetypes = { 'css', 'sass', 'scss' }
})
lspconfig.tsserver.setup({})
lspconfig.yamlls.setup({})

@ -0,0 +1,5 @@
require('lualine').setup({
options = {
theme = 'gruvbox',
},
})

@ -0,0 +1,8 @@
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
},
indent = {
enable = true,
},
})

@ -0,0 +1,13 @@
local g = vim.g
-- vsnip config
g.vsnip_snippet_dirs = {
os.getenv('HOME') .. '/Dotfiles/nvim/plugged/friendly-snippets/snippets',
os.getenv('HOME') .. '/Dotfiles/snippets/',
}
g.vsnip_filetypes = {
sass = { 'css' },
scss = { 'css' },
javascriptreact = { 'javascript' },
typescriptreact = { 'typescript', 'javascript' },
}

@ -1,121 +1,117 @@
local lspconfig = require('lspconfig') local fn = vim.fn
local cmd = vim.cmd local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
local g = vim.g if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({
'git', 'clone', '--depth', '1',
'https://github.com/wbthomason/packer.nvim',
install_path
})
end
lspconfig.cssls.setup({ function get_config(name)
filetypes = { 'css', 'sass', 'scss' }, return string.format("require(\"config/%s\")", name)
settings = { end
css = {
validate = false, return require('packer').startup(function(use)
}, -- packer itself
scss = { use 'wbthomason/packer.nvim'
validate = false,
}, -- tpope general better-vim-plugins
sass = { use 'tpope/vim-apathy'
validate = false, use 'tpope/vim-commentary'
}, use 'tpope/vim-fugitive'
}, use 'tpope/vim-ragtag'
}) use 'tpope/vim-repeat'
lspconfig.eslint.setup({}) use 'tpope/vim-surround'
lspconfig.html.setup({}) use 'tpope/vim-unimpaired'
lspconfig.jsonls.setup({})
lspconfig.phpactor.setup({})
lspconfig.stylelint_lsp.setup({
filetypes = { 'css', 'sass', 'scss' }
})
lspconfig.tsserver.setup({})
lspconfig.yamlls.setup({})
-- treesitter -- other general plugins
require('nvim-treesitter.configs').setup({ use 'christoomey/vim-tmux-navigator'
highlight = { use 'editorconfig/editorconfig-vim'
enable = true, use 'wellle/targets.vim'
}, use 'wincent/terminus'
indent = {
enable = true,
},
})
require('lualine').setup({ -- lsp and treesitter
options = { use {
theme = 'gruvbox', 'neovim/nvim-lspconfig',
}, config = get_config('lspconfig'),
}) }
use {
'nvim-treesitter/nvim-treesitter',
config = get_config('treesitter'),
run = ":TSUpdate",
}
require('hop').setup({}) -- fzf integration
use {
'ibhagwan/fzf-lua',
config = get_config('fzf'),
requires = {
{ 'kyazdani42/nvim-web-devicons', opt = true },
},
}
-- hop navigation
use {
'phaazon/hop.nvim',
config = get_config('hop'),
}
require('nvim-autopairs').setup({}) -- autoparis
use {
'windwp/nvim-autopairs',
config = get_config('autopairs'),
}
require('fzf-lua').setup({ -- nice status line
winopts = { use {
width = 0.80, 'nvim-lualine/lualine.nvim',
height = 0.78, config = get_config('lualine'),
row = 0.45, event = 'VimEnter',
col = 0.48, requires = {
}, { 'kyazdani42/nvim-web-devicons', opt = true }
}) },
}
-- autocompletion
use {
'hrsh7th/nvim-cmp',
config = get_config('cmp'),
requires = {
'andersevenrud/cmp-tmux',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-calc',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-vsnip',
},
}
local cmp = require('cmp') -- snippets
cmp.setup({ use {
completion = { 'hrsh7th/vim-vsnip',
keyword_length = 1, -- TODO set this back 3, when fine with snippets config = get_config('vsnip'),
}, }
snippet = { use {
expand = function(args) 'rafamadriz/friendly-snippets',
vim.fn["vsnip#anonymous"](args.body) requires = {
end, 'hrsh7th/vim-vsnip'
},
mapping = {
['<cr>'] = cmp.mapping.confirm({ select = true }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{
name = 'buffer',
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end
},
}, },
{ name = 'path' }, }
{ name = 'tmux', option = { all_panes = true } }, -- TODO 'true' makes things sloppy
{ name = 'calc' },
}),
formatting = { use {
format = function(entry, vim_item) 'voldikss/vim-floaterm',
vim_item.menu = ({ config = get_config('floaterm'),
buffer = "[Buffer]", }
calc = "[Calc]",
nvim_lsp = "[LSP]",
path = "[Path]",
tmux = "[tmux]",
vsnip = "[Snippet]",
})[entry.source.name]
return vim_item
end
},
})
-- vsnip config -- colorscheme
g.vsnip_snippet_dirs = { use {
os.getenv('HOME') .. '/Dotfiles/nvim/plugged/friendly-snippets/snippets', 'ellisonleao/gruvbox.nvim',
os.getenv('HOME') .. '/Dotfiles/snippets/', requires = { 'rktjmp/lush.nvim' },
} }
g.vsnip_filetypes = {
sass = { 'css' },
scss = { 'css' },
javascriptreact = { 'javascript' },
typescriptreact = { 'typescript', 'javascript' },
}
-- floaterm -- Automatically set up configuration after cloning packer.nvim
g.floaterm_width = 0.8 if packer_bootstrap then
g.floaterm_height = 0.8 require('packer').sync()
g.floaterm_autoclose = 1 end
g.floaterm_opener = 'edit' end)
g.floaterm_borderchars = '─│─│╭╮╯╰'
g.floaterm_title = ''
cmd("au VimEnter * highlight FloatermBorder guibg='#282828' guifg='#fbf1c7'")

@ -1 +0,0 @@
**/*
Loading…
Cancel
Save