Skip to content

Commit

Permalink
X profile and llm nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerthecoder committed Jul 23, 2024
1 parent d2d7b08 commit 3c2de22
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 7 deletions.
1 change: 1 addition & 0 deletions common/config/.alias
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
alias ls='ls --color=auto'
alias lg='lazygit'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
Expand Down
50 changes: 50 additions & 0 deletions comps/framework-arch/.Xresources
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Xcursor.theme: cursor-theme
Xcursor.size: 16

! special
*.foreground: #d0d0d0
*.background: #000000
*.cursorColor: #d0d0d0

! black
*.color0: #000000
*.color8: #808080

! red
*.color1: #ff0000
*.color9: #ff0000

! green
*.color2: #33ff00
*.color10: #33ff00

! yellow
*.color3: #ff0099
*.color11: #ff0099

! blue
*.color4: #0066ff
*.color12: #0066ff

! magenta
*.color5: #cc00ff
*.color13: #cc00ff

! cyan
*.color6: #00ffff
*.color14: #00ffff

! white
*.color7: #d0d0d0
*.color15: #ffffff

/* Xft.dpi: 220 */
/* Xft.autohint: 0 */
/* Xft.lcdfilter: lcddefault */
/* Xft.hintstyle: hintfull */
/* Xft.hinting: 1 */
/* Xft.antialias: 1 */

! Rofi Config
rofi.dpi: 220

2 changes: 1 addition & 1 deletion comps/framework-arch/.shenv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export DEV_PATH="/home/tylord/dev"

# Programs
export EDITOR="nvim"
export BROWSER="brave"
export BROWSER="chromium"
export TERMINAL="terminator"
export TERMIANL_ROLE="terminator --role"
export TERMINAL_EXEC="terminator -e"
Expand Down
9 changes: 9 additions & 0 deletions comps/framework-arch/.xprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Set the cursor speed (wait time, dups per second)
xset r rate 300 35

# Set the "theme"
[[ -f ~/.config/X/.Xresources ]] && xrdb -merge -I$HOME ~/.config/X/.Xresources

setxkbmap -option caps:super

feh --bg-fill ~/docs/media/backgrounds/joker.jpg
8 changes: 8 additions & 0 deletions comps/framework-arch/owl-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
"source": "comps/framework-arch/.alias",
"target": "~/.config/alias/main"
},
{
"source": "comps/framework-arch/.xprofile",
"target": "~/.xprofile"
},
{
"source": "comps/framework-arch/.Xresources",
"target": "~/.config/X/Xresources"
},
{
"source": "common/config/.alias",
"target": "~/.config/alias/base"
Expand Down
69 changes: 69 additions & 0 deletions setups/nvim/after/plugin/llm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
local system_prompt =
'You should replace the code that you are sent, only following the comments. Do not talk at all. Only output valid code. Do not provide any backticks that surround the code. Never ever output backticks like this ```. Any comment that is asking you for something should be removed after you satisfy them. Other comments should left alone. Do not output backticks'
local helpful_prompt =
'You are a helpful assistant. What I have sent are my notes so far. You are very curt, yet helpful.'
require('llm').setup {
timeout_ms = 3000,
services = {
groq = {
url = 'https://api.groq.com/openai/v1/chat/completions',
model = 'llama3-70b-8192',
api_key_name = 'GROQ_API_KEY',
system_prompt = system_prompt,
},
groq_help = {
url = 'https://api.groq.com/openai/v1/chat/completions',
model = 'llama3-70b-8192',
api_key_name = 'GROQ_API_KEY',
system_prompt = helpful_prompt,
},
openai = {
url = 'https://api.openai.com/v1/chat/completions',
model = 'gpt-4o',
api_key_name = 'OPENAI_API_KEY',
-- system_prompt = system_prompt,
},
openai_help = {
url = 'https://api.openai.com/v1/chat/completions',
model = 'gpt-4o',
api_key_name = 'OPENAI_API_KEY',
-- system_prompt = helpful_prompt,
},
claude = {
url = 'https://api.anthropic.com/v1/messages',
model = 'claude-3-5-sonnet-20240620',
api_key_name = 'ANTHROPIC_API_KEY',
system_prompt = system_prompt,
},
claude_help = {
url = 'https://api.anthropic.com/v1/messages',
model = 'claude-3-5-sonnet-20240620',
api_key_name = 'ANTHROPIC_API_KEY',
system_prompt = helpful_prompt,
},
},
}

vim.keymap.set('v', '<leader>k', function()
require('llm').prompt { replace = true, service = 'groq' }
end, { desc = 'Prompt with groq (replace = true)' })

vim.keymap.set('v', '<leader>K', function()
require('llm').prompt { replace = false, service = 'groq_help' }
end, { desc = 'Prompt with groq (replace = false)' })

vim.keymap.set('v', '<leader>L', function()
require('llm').prompt { replace = false, service = 'openai_help' }
end, { desc = 'Prompt with openai (replace = false)' })

vim.keymap.set('v', '<leader>l', function()
require('llm').prompt { replace = true, service = 'openai' }
end, { desc = 'Prompt with openai (replace = true)' })

vim.keymap.set('n', '<leader>I', function()
require('llm').prompt { replace = false, service = 'anthropic' }
end, { desc = 'Prompt with anthropic (replace = false)' })

vim.keymap.set('n', '<leader>i', function()
require('llm').prompt { replace = true, service = 'anthropic_help' }
end, { desc = 'Prompt with anthropic (replace = true)' })
14 changes: 8 additions & 6 deletions setups/nvim/lua/tylord/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ return require('packer').startup(function(use)
requires = { { "nvim-lua/plenary.nvim" } }
}

-- Copilot
-- use 'github/copilot.vim'
-- AI
use { "zbirenbaum/copilot.lua" }
use {
"zbirenbaum/copilot-cmp",
Expand All @@ -52,6 +51,12 @@ return require('packer').startup(function(use)
require("copilot_cmp").setup()
end
}
use {
"melbaldove/llm.nvim",
requires = { "nvim-neotest/nvim-nio" },
}
-- use { 'huggingface/llm.nvim' }
-- use 'github/copilot.vim'

-- LSP
use 'neovim/nvim-lspconfig'
Expand All @@ -62,10 +67,7 @@ return require('packer').startup(function(use)
use 'mfussenegger/nvim-lint'

-- Formatting
use {
'stevearc/conform.nvim',
config = function() require('conform').setup() end
}
use { 'stevearc/conform.nvim' }

-- Completions
use 'hrsh7th/nvim-cmp'
Expand Down

0 comments on commit 3c2de22

Please sign in to comment.