initial commit

This commit is contained in:
azathoth 2024-07-07 00:57:57 -04:00
commit d70edfea3c
21 changed files with 452 additions and 0 deletions

7
.config/.zshenv Normal file
View File

@ -0,0 +1,7 @@
# vi: ft=zsh
# move or link this file to ~/.zshenv
# e.g., ln -s ~/.config/home.zshenv ~/.zshenv
ZDOTDIR=~/.config/zsh
. $ZDOTDIR/.zshenv

1
.config/nvim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/lazy-lock.json

5
.config/nvim/.luarc.json Normal file
View File

@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}

4
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,4 @@
require('config.set')
require('config.remap')
require('config.netrw')
require('config.lazy')

View File

@ -0,0 +1,20 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require('lazy').setup({
spec = {
-- import your plugins
{ import = 'plugins' },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { 'gruvbox' } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@ -0,0 +1,4 @@
vim.g.netrw_liststyle = 3
vim.g.netrw_banner = 0
vim.keymap.set('n', '<leader>pv', vim.cmd.Ex)

View File

@ -0,0 +1,6 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
vim.keymap.set('n', '<Esc><Esc>', vim.cmd.nohl)
vim.keymap.set('n', '<leader>sh', ':sp<CR>')
vim.keymap.set('n', '<leader>sv', ':vsp<CR>')

View File

@ -0,0 +1,14 @@
vim.o.number = true
vim.o.relativenumber = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = false
vim.o.smartindent = true
vim.o.wrap = false
vim.o.list = true
vim.o.listchars = 'tab:| ,trail:_'
vim.o.foldlevelstart = 1
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.mouse = ''
vim.o.cursorline = true

View File

@ -0,0 +1,68 @@
return {
{
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
dependencies = {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
{
'L3MON4D3/LuaSnip',
version = 'v2.*',
build = 'make install_jsregexp'
},
'saadparwaiz1/cmp_luasnip',
'rafamadriz/friendly-snippets',
'onsails/lspkind.nvim'
},
config = function()
local cmp = require('cmp')
local luasnip = require('luasnip')
local lspkind = require('lspkind')
require('luasnip.loaders.from_vscode').lazy_load()
cmp.setup({
completion = {
completeopt = 'menu,menuon,preview,noselect'
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' }
}),
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = '...',
})
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(4),
['<C-f>'] = cmp.mapping.scroll_docs(-4),
['<Esc>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then cmp.select_next_item()
elseif luasnip.expandable() then luasnip.expand()
elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump()
else fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then cmp.select_prev_item()
elseif luasnip.jumpable(-1) then luasnip.jump(-1)
else fallback()
end
end, { 'i', 's' })
})
})
end
}
}

View File

@ -0,0 +1,12 @@
return {
{
'tpope/vim-fugitive'
},
{
'lewis6991/gitsigns.nvim',
opts = {
current_line_blame = true
},
config = true
},
}

View File

@ -0,0 +1,141 @@
return {
{
'ellisonleao/gruvbox.nvim',
priority = 1000,
config = function()
vim.cmd('colorscheme gruvbox')
vim.o.background = 'dark'
vim.cmd('hi Normal guibg=None')
end
},
{
'folke/todo-comments.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = true
},
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
dependencies = { 'hrsh7th/nvim-cmp' },
opts = {
check_ts = true,
-- ts_config = {
-- lua = { 'string' }
-- }
},
config = function(_, opts)
require('nvim-autopairs').setup(opts)
require('cmp').event:on('confirm_done', require('nvim-autopairs.completion.cmp').on_confirm_done())
end
},
{
'prichrd/netrw.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = true
},
-- {
-- 'norcalli/nvim-colorizer.lua',
-- opts = { "*" },
-- config = function(_, opts)
-- require('colorizer').setup(opts)
-- end
-- },
{
'brenoprata10/nvim-highlight-colors',
event = { 'BufReadPre', 'BufNewFile' },
opts = {
render = 'virtual',
virtual_symbol_position = 'eol',
virtual_symbol_suffix = '',
virtual_symbol = ''
},
config = function(_, opts)
vim.opt.termguicolors = true
require('nvim-highlight-colors').setup(opts)
end
},
{
'numToStr/Comment.nvim',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
'JoosepAlviste/nvim-ts-context-commentstring'
},
config = function(_, opts)
require('Comment').setup(vim.tbl_deep_extend('force', opts, {
pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()
}))
end
},
(
'tpope/vim-vinegar'
),
{
'tpope/vim-surround'
},
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons'
},
config = function(_, opts)
require('telescope').setup(opts)
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
end
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
event = 'VeryLazy',
opts = {
theme = 'lualine.themes.gruvbox'
},
config = true
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
'bash',
'html',
'json',
'lua',
'markdown',
'markdown_inline',
'python',
'regex',
'vim',
'vimdoc',
'yaml',
'terraform',
},
},
config = function(_, opts)
require('nvim-treesitter.configs').setup(opts)
end
},
{
'stsewd/isort.nvim',
ft = 'python',
build = { ':MasonInstall isort', ':UpdateRemotePlugins' }
},
{
'vimwiki/vimwiki',
init = function()
vim.g.vimwiki_list = {
{
path = '~/.local/share/nvim/vimwiki/'
}
}
end
}
}

View File

@ -0,0 +1,111 @@
return {
{
'williamboman/mason.nvim',
dependencies = {
'williamboman/mason-lspconfig.nvim'
},
opts = {
mason = {
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
},
masonlsp = {
ensure_installed = {
'basedpyright',
'lua_ls',
'terraformls',
'tflint',
},
}
},
config = function(_, opts)
require('mason').setup(opts.mason)
require('mason-lspconfig').setup(opts.masonlsp)
end
},
{
'folke/trouble.nvim',
cmd = 'Trouble',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = true,
keys = {
{ '<leader>xx', '<cmd>Trouble diagnostics toggle<CR>', desc = 'Diagnostics (Trouble)' },
{ '<leader>xX', '<cmd>Trouble diagnostics toggle filter.buf=0<CR>', desc = 'Buffer Diagnostics (Trouble)' },
{ '<leader>xQ', '<cmd>Trouble qflist toggle<CR>', desc = 'Quickfix List (Trouble)' },
{ '<leader>xL', '<cmd>Trouble loclist toggle<CR>', desc = 'Location List (Trouble)' },
{ '<leader>xt', '<cmd>Trouble todo<CR>', desc = 'Open TODOs in trouble' }
}
},
{
'neovim/nvim-lspconfig',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
'hrsh7th/cmp-nvim-lsp',
{ 'antosha417/nvim-lsp-file-operations', config = true },
},
config = function()
local lsp = require('lspconfig')
local cap = require('cmp_nvim_lsp').default_capabilities()
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(e)
local _opts = { buffer = e.buf, silent = true }
local keymap = vim.keymap
_opts.desc = "Show LSP references"
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<CR>', _opts)
_opts.desc = "Go to declaration"
keymap.set('n', 'gD', vim.lsp.buf.declaration, _opts)
_opts.desc = "Show LSP definitions"
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', _opts)
_opts.desc = "Show LSP implementations"
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', _opts)
_opts.desc = 'Show LSP type definitions'
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', _opts)
_opts.desc = 'See available code actions'
keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, _opts)
_opts.desc = 'Smart rename'
keymap.set('n', '<leader>rn', vim.lsp.buf.rename, _opts)
_opts.desc = 'Show buffer diagnostics'
keymap.set('n', '<leader>D', '<cmd>Telescope diagnostics bufnr=0<CR>', _opts)
_opts.desc = 'Show line diagnostics'
keymap.set('n', '<leader>d', vim.diagnostic.open_float, _opts)
_opts.desc = 'Go to previous diagnostic'
keymap.set('n', '[d', vim.diagnostic.goto_prev, _opts)
_opts.desc = 'Go to next diagnostic'
keymap.set('n', ']d', vim.diagnostic.goto_next, _opts)
_opts.desc = 'Show documentation for what is under cursor'
keymap.set('n', 'K', vim.lsp.buf.hover, _opts)
_opts.desc = 'Restart LSP'
keymap.set('n', '<leader>rs', ':LspRestart<CR>', _opts)
end
})
require('mason-lspconfig').setup_handlers({
function(server_name)
lsp[server_name].setup({
capabilities = cap
})
end,
})
end
}
}

16
.config/zsh/.zshenv Normal file
View File

@ -0,0 +1,16 @@
typeset -U path
path=(~/.local/bin $path)
export XDG_CONFIG_HOME=~/.config
export XDG_CACHE_HOME=~/.cache
export XDG_DATA_HOME=~/.local/share
export XDG_STATE_HOME=~/.local/state
source $XDG_CONFIG_HOME/user-dirs.dirs
export GNUPGHOME=${XDG_CONFIG_HOME}/gnupg
export PASSWORD_STORE_DIR=${XDG_DATA_HOME}/pass
export BROWSER=librewolf-wayland
export EDITOR=nvim

21
.config/zsh/.zshrc Normal file
View File

@ -0,0 +1,21 @@
autoload -U colors && colors
setopt AUTO_CD
setopt MARK_DIRS
mkdir -p ~/.cache/zsh
HISTFILE=~/.cache/zsh/history
HISTSIZE=1000
SAVEHIST=1000
setopt SHARE_HISTORY
setopt HIST_LEX_WORDS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_NO_STORE
eval $(dircolors)
setopt PROMPT_SUBST
for f in ${ZDOTDIR}/include/*(.); source $f
PROMPT='%F{cyan}%n%f@%F{green}%m%f:${vcs_info_msg_0_}%F{yellow}%~%f > '

View File

@ -0,0 +1,2 @@
# vim: ft=zsh
alias ls="ls --color=always"

View File

@ -0,0 +1,9 @@
# vim: ft=zsh
autoload -Uz add-zsh-hook vcs_info
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr ' %F{red}*'
zstyle ':vcs_info:*' stagedstr ' %F{red}+'
zstyle ':vcs_info:git:*' formats '%F{blue}%b%u%c%f:'
zstyle ':vcs_info:git:*' actionformats '%F{blue}%b$f:|%a%u%c%f:'

View File

@ -0,0 +1,2 @@
# vim: ft=zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
lazy-lock.json

1
.stow-local-ignore Normal file
View File

@ -0,0 +1 @@
lazy-lock.json

4
.zshenv Normal file
View File

@ -0,0 +1,4 @@
# vim: ft=zsh
ZDOTDIR=~/.config/zsh
. $ZDOTDIR/.zshenv

3
README.md Normal file
View File

@ -0,0 +1,3 @@
Assuming this repo is in ~/git/dotfiles
`stow -t ~ .`