Move to packer, now fully lua
parent
db13e00c47
commit
fdac908cfd
@ -1,7 +1,7 @@
|
||||
karabiner/automatic_backups/*
|
||||
lazygit/state.yml
|
||||
nvim/.netrwhist
|
||||
nvim/autoload/plug.vim.old
|
||||
nvim/plugin/*
|
||||
office/mutt/cache/*
|
||||
office/mutt/tmp/*
|
||||
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 cmd = vim.cmd
|
||||
local g = vim.g
|
||||
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
|
||||
packer_bootstrap = fn.system({
|
||||
'git', 'clone', '--depth', '1',
|
||||
'https://github.com/wbthomason/packer.nvim',
|
||||
install_path
|
||||
})
|
||||
end
|
||||
|
||||
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({})
|
||||
function get_config(name)
|
||||
return string.format("require(\"config/%s\")", name)
|
||||
end
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- packer itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- tpope general better-vim-plugins
|
||||
use 'tpope/vim-apathy'
|
||||
use 'tpope/vim-commentary'
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-ragtag'
|
||||
use 'tpope/vim-repeat'
|
||||
use 'tpope/vim-surround'
|
||||
use 'tpope/vim-unimpaired'
|
||||
|
||||
-- treesitter
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
-- other general plugins
|
||||
use 'christoomey/vim-tmux-navigator'
|
||||
use 'editorconfig/editorconfig-vim'
|
||||
use 'wellle/targets.vim'
|
||||
use 'wincent/terminus'
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'gruvbox',
|
||||
},
|
||||
})
|
||||
-- lsp and treesitter
|
||||
use {
|
||||
'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({
|
||||
winopts = {
|
||||
width = 0.80,
|
||||
height = 0.78,
|
||||
row = 0.45,
|
||||
col = 0.48,
|
||||
},
|
||||
})
|
||||
-- nice status line
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = get_config('lualine'),
|
||||
event = 'VimEnter',
|
||||
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')
|
||||
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
|
||||
},
|
||||
-- snippets
|
||||
use {
|
||||
'hrsh7th/vim-vsnip',
|
||||
config = get_config('vsnip'),
|
||||
}
|
||||
use {
|
||||
'rafamadriz/friendly-snippets',
|
||||
requires = {
|
||||
'hrsh7th/vim-vsnip'
|
||||
},
|
||||
{ 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
|
||||
},
|
||||
})
|
||||
use {
|
||||
'voldikss/vim-floaterm',
|
||||
config = get_config('floaterm'),
|
||||
}
|
||||
|
||||
-- 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' },
|
||||
}
|
||||
-- colorscheme
|
||||
use {
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
requires = { 'rktjmp/lush.nvim' },
|
||||
}
|
||||
|
||||
-- floaterm
|
||||
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'")
|
||||
-- Automatically set up configuration after cloning packer.nvim
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
@ -1 +0,0 @@
|
||||
**/*
|
Loading…
Reference in New Issue