Skip to content

Commit

Permalink
uh, commit a lot of ongoing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjahn committed Jan 19, 2023
1 parent 0b4cbe8 commit c735d29
Show file tree
Hide file tree
Showing 24 changed files with 439 additions and 251 deletions.
11 changes: 8 additions & 3 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ tap "universal-ctags/universal-ctags"
tap "aws/tap"

# Utils
brew "asdf"
brew "pyenv"
brew "rbenv"

# brew "awscli"
# brew "gnupg21"
brew "ag"
brew "asdf"
brew "aws-sam-cli"
brew "bat"
brew "cmake"
brew "direnv"
brew "docker"
brew "docker-compose"
brew "docker-machine"
Expand All @@ -29,18 +28,24 @@ brew "fish"
brew "fzf"
brew "git"
brew "gnupg"
brew "golang"
brew "htop"
brew "httpie"
brew "hub"
brew "imagemagick"
brew "lima"
brew "lua-language-server"
brew "neovim", args: %w[HEAD]
brew "node"
brew "pinentry-mac"
brew "pyenv"
brew "rbenv"
brew "rcm"
brew "reattach-to-user-namespace"
brew "ripgrep"
brew "rust-analyzer"
brew "shellcheck"
brew "shfmt"
brew "switchaudio-osx"
brew "tldr"
brew "tmux"
Expand Down
4 changes: 2 additions & 2 deletions config/alacritty/alacritty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ window:
# Font configuration
font:
# Normal (roman) font face
#normal:
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
#family: monospace
family: MesloLGL Nerd Font Mono

# The `style` can be specified to pick a specific face.
#style: Regular
Expand Down
57 changes: 57 additions & 0 deletions config/direnv/direnvrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# use nvm
# To use:
# 1) Node version specified in package.json, in .envrc add:
# use nvm package.json
# This requires that package.json contains something like
# "engines": {
# "node": ">=6.9.2"
# },
#
# 2) Node version specified in .node-version add:
# use nvm node-version
#
# 3) Node version specified in .envrc add:
# use nvm 6.9.2
#
# 4) Node version specified in .nvmrc, in .envrc add:
# use nvm
use_nvm() {
local node_version=$1

if [[ $node_version = "package.json" ]]; then
if has jq; then
node_version=$(jq --raw-output .engines.node package.json | tr -d "<=> ")
else
echo "Parsing package.json for node version to use with direnv requires jq"
fi
elif [[ $node_version = "node-version" ]]; then
node_version=$(cat .node-version)
fi

nvm_sh=~/.nvm/nvm.sh
if [[ -e $nvm_sh ]]; then
source $nvm_sh
nvm use $node_version --silent
fi
}

# use rbenv
# To use:
# 1) Ruby version specified in .ruby-version add:
# use rbenv ruby-version
#
# 2) Ruby version specified in .envrc add:
# use rbenv 6.9.2
use_rbenv() {
local ruby_version=$1

if [[ $ruby_version = "ruby-version" ]]; then
ruby_version=$(cat .ruby-version)
fi

rbenv_dir=~/.rbenv
if [[ -e $rbenv_dir ]]; then
export RUBY_VERSION=$ruby_version
rbenv shell -
fi
}
6 changes: 3 additions & 3 deletions config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ if (has("termguicolors"))
endif
if has("nvim") " Configure UI Colors
" This is only necessary if you use "set termguicolors".
"let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
"let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
"set termguicolors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors

" fixes glitch? in colors when using vim with tmux
"set t_Co=256
Expand Down
37 changes: 37 additions & 0 deletions config/nvim/lua/_autopairs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
local vim = vim

local npairs = require("nvim-autopairs")
npairs.setup()

-- clear all rule if you don"t want to use autopairs
--npairs.clear_rules()
local endwise = require("nvim-autopairs.ts-rule").endwise

npairs.add_rules({
-- then$ is a lua regex
-- end is a match pair
-- lua is a filetype
-- if_statement is a treesitter name. set it = nil to skip check with treesitter
endwise("then$", "end", "lua", "if_statement"),
})


local remap = vim.api.nvim_set_keymap
-- skip it, if you use another global object
_G.MUtils = {}

vim.g.completion_confirm_key = ""
MUtils.completion_confirm = function()
if vim.fn.pumvisible() ~= 0 then
if vim.fn.complete_info()["selected"] ~= -1 then
return vim.fn["compe#confirm"](npairs.esc("<cr>"))
else
return npairs.esc("<cr>")
end
else
return npairs.autopairs_cr()
end
end


remap("i", "<CR>", "v:lua.MUtils.completion_confirm()", { expr = true, noremap = true })
6 changes: 6 additions & 0 deletions config/nvim/lua/_codeium.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local vim = vim


vim.keymap.set(
'i', '<C-g>', function() vim.fn['codeium#Accept']() end,
{ silent = true, noremap = true })
13 changes: 13 additions & 0 deletions config/nvim/lua/_colors.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local vim = vim

-- local active_buffer_bg = "#2E373D"

vim.cmd [[set background=dark]]
vim.cmd [[let g:everforest_background = 'soft']]
vim.cmd [[let g:everforest_enable_italic = 1]]
vim.cmd [[let g:everforest_dim_inactive_windows = 1]]
vim.cmd [[
let g:everforest_colors_override = {'bg0': ['#2E373D', '235']}
]]
-- vim.cmd[[let g:everforest_ui_contrast = 'high']]
vim.cmd [[colorscheme everforest]]
58 changes: 30 additions & 28 deletions config/nvim/lua/completion.lua → config/nvim/lua/_completion.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
local use = require('packer').use

use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-cmdline'
use 'hrsh7th/cmp-calc'
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-vsnip'
use 'hrsh7th/vim-vsnip'
use 'andersevenrud/cmp-tmux'


local vim = vim
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
Expand All @@ -21,7 +10,7 @@ local feedkey = function(key, mode)
end

-- Set up nvim-cmp.
local cmp = require'cmp'
local cmp = require 'cmp'

cmp.setup({
snippet = {
Expand All @@ -31,10 +20,23 @@ cmp.setup({
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},

formatting = {
format = function(entry, vim_item)
if vim.tbl_contains({ 'path' }, entry.source.name) then
local icon, hl_group = require('nvim-web-devicons').get_icon(entry:get_completion_item().label)
if icon then
vim_item.kind = icon
vim_item.kind_hl_group = hl_group
return vim_item
end
end
return require('lspkind').cmp_format({ with_text = false })(entry, vim_item)
end
},
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
Expand All @@ -56,14 +58,14 @@ cmp.setup({
end
end, { "i", "s" }),

['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
},

sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'calc' },
{ name = 'tmux' },
-- { name = 'tmux' },
}, {
{ name = 'buffer' },
})
Expand Down Expand Up @@ -106,18 +108,18 @@ cmp.event:on(

-- Colorize completion types
-- gray
vim.cmd[[highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080]]
vim.cmd [[highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080]]
-- blue
vim.cmd[[highlight! CmpItemAbbrMatch guibg=NONE guifg=#569CD6]]
vim.cmd[[highlight! link CmpItemAbbrMatchFuzzy CmpItemAbbrMatch]]
vim.cmd [[highlight! CmpItemAbbrMatch guibg=NONE guifg=#569CD6]]
vim.cmd [[highlight! link CmpItemAbbrMatchFuzzy CmpItemAbbrMatch]]
-- light blue
vim.cmd[[highlight! CmpItemKindVariable guibg=NONE guifg=#9CDCFE]]
vim.cmd[[highlight! link CmpItemKindInterface CmpItemKindVariable]]
vim.cmd[[highlight! link CmpItemKindText CmpItemKindVariable]]
vim.cmd [[highlight! CmpItemKindVariable guibg=NONE guifg=#9CDCFE]]
vim.cmd [[highlight! link CmpItemKindInterface CmpItemKindVariable]]
vim.cmd [[highlight! link CmpItemKindText CmpItemKindVariable]]
-- pink
vim.cmd[[highlight! CmpItemKindFunction guibg=NONE guifg=#C586C0]]
vim.cmd[[highlight! link CmpItemKindMethod CmpItemKindFunction]]
vim.cmd [[highlight! CmpItemKindFunction guibg=NONE guifg=#C586C0]]
vim.cmd [[highlight! link CmpItemKindMethod CmpItemKindFunction]]
-- front
vim.cmd[[highlight! CmpItemKindKeyword guibg=NONE guifg=#D4D4D4]]
vim.cmd[[highlight! link CmpItemKindProperty CmpItemKindKeyword]]
vim.cmd[[highlight! link CmpItemKindUnit CmpItemKindKeyword]]
vim.cmd [[highlight! CmpItemKindKeyword guibg=NONE guifg=#D4D4D4]]
vim.cmd [[highlight! link CmpItemKindProperty CmpItemKindKeyword]]
vim.cmd [[highlight! link CmpItemKindUnit CmpItemKindKeyword]]
Loading

0 comments on commit c735d29

Please sign in to comment.