-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
439 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.