update neovim config to use lazy, fix some issues with screens in general
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
Xcursor.size: 16
|
||||||
Xft.autohint: 1
|
Xft.autohint: 1
|
||||||
Xft.lcdfilter: lcddefault
|
Xft.lcdfilter: lcddefault
|
||||||
Xft.hintstyle: hintfull
|
Xft.hintstyle: hintfull
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
live_config_reload = true
|
|
||||||
|
|
||||||
import = [
|
|
||||||
"~/.config/alacritty/my_theme.toml"
|
|
||||||
]
|
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
TERM = "alacritty"
|
TERM = "alacritty"
|
||||||
|
|
||||||
[shell]
|
[terminal.shell]
|
||||||
program = "/bin/zsh"
|
program = "/bin/zsh"
|
||||||
|
|
||||||
[window]
|
[window]
|
||||||
padding = { x = 5, y = 5}
|
padding = { x = 5, y = 5}
|
||||||
dynamic_padding = true
|
dynamic_padding = true
|
||||||
decorations = "None"
|
decorations = "Full"
|
||||||
startup_mode = "Windowed"
|
startup_mode = "Windowed"
|
||||||
|
|
||||||
|
|
||||||
@@ -26,3 +21,12 @@ normal = { family = "Hack Nerd Font" }
|
|||||||
|
|
||||||
[cursor]
|
[cursor]
|
||||||
style = {shape = "underline", blinking = "Always"}
|
style = {shape = "underline", blinking = "Always"}
|
||||||
|
|
||||||
|
[general]
|
||||||
|
live_config_reload = true
|
||||||
|
|
||||||
|
import = [
|
||||||
|
"~/.config/alacritty/my_theme.toml"
|
||||||
|
]
|
||||||
|
|
||||||
|
[terminal]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[colors.primary]
|
[colors.primary]
|
||||||
background = "#161616"
|
background = "#0C0C0C"
|
||||||
foreground = "#CCCCCC"
|
foreground = "#CCCCCC"
|
||||||
|
|
||||||
[colors.normal]
|
[colors.normal]
|
||||||
|
|||||||
Regular → Executable
@@ -169,12 +169,12 @@ mode "resize" {
|
|||||||
bindsym $mod+r mode "resize"
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
focus_follows_mouse no
|
focus_follows_mouse no
|
||||||
set_from_resource $FOCUS iw3m.color2
|
#set_from_resource $FOCUS iw3m.color2
|
||||||
set_from_resource $URGENT iw3m.color1
|
#set_from_resource $URGENT iw3m.color1
|
||||||
set_from_resource $UNFOCUS iw3m.color7
|
#set_from_resource $UNFOCUS iw3m.color7
|
||||||
|
|
||||||
client.focused $FOCUS $FOCUS "#FFFFFF" $FOCUS $FOCUS
|
#client.focused $FOCUS $FOCUS "#FFFFFF" $FOCUS $FOCUS
|
||||||
client.urgent $URGENT $URGENT "#FFFFFF" $URGENT $URGENT
|
#client.urgent $URGENT $URGENT "#FFFFFF" $URGENT $URGENT
|
||||||
|
|
||||||
# default colors
|
# default colors
|
||||||
client.focused_inactive #333333 #222222 #888888 #292d2e #222222
|
client.focused_inactive #333333 #222222 #888888 #292d2e #222222
|
||||||
@@ -194,5 +194,7 @@ hide_edge_borders none
|
|||||||
gaps inner 0
|
gaps inner 0
|
||||||
gaps outer 0
|
gaps outer 0
|
||||||
|
|
||||||
|
exec_always --no-startup-id feh --bg-scale --randomize ~/.wallpapers/
|
||||||
|
# wal -i ~/.wallpapers
|
||||||
exec_always --no-startup-id ~/.config/dunst/start.sh
|
exec_always --no-startup-id ~/.config/dunst/start.sh
|
||||||
exec_always --no-startup-id ~/.config/polybar/launch.sh
|
exec_always --no-startup-id ~/.config/polybar/launch.sh
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
let g:neovide_refresh_rate=140
|
|
||||||
let g:coq_settings = { 'auto_start': 'shut-up' }
|
|
||||||
+40
-626
@@ -1,9 +1,11 @@
|
|||||||
-- some basic options
|
-- some basic options
|
||||||
local vim = vim
|
local vim = vim
|
||||||
|
local fn = vim.fn
|
||||||
|
vim.g.mapleader = "\\"
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
-- nvim tree said to disable netrw
|
vim.g.noswapfile = true
|
||||||
vim.g.loaded_netrw = 1
|
vim.g.python3_host_prog = fn.exepath("python3")
|
||||||
vim.g.loaded_netrwPlugin = 1
|
|
||||||
|
|
||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
@@ -14,36 +16,30 @@ vim.opt.autoindent = true
|
|||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
vim.opt.smarttab = true
|
vim.opt.smarttab = true
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.o.hidden = true
|
|
||||||
vim.o.signcolumn = 'auto'
|
|
||||||
-- vim.o.breakindent = false -- I think this looks bad
|
|
||||||
vim.o.errorbells = true
|
|
||||||
vim.o.clipboard = "unnamedplus"
|
|
||||||
vim.g.noswapfile = true
|
|
||||||
vim.cmd [[set mouse=a]] -- enable mouse
|
|
||||||
vim.wo.cursorline = true
|
|
||||||
vim.opt.hlsearch = false
|
vim.opt.hlsearch = false
|
||||||
vim.opt.wrap = true
|
vim.opt.wrap = true
|
||||||
vim.opt.linebreak = true
|
vim.opt.linebreak = true
|
||||||
vim.opt.showmatch = true
|
vim.opt.showmatch = true
|
||||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' }
|
vim.opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' }
|
||||||
vim.opt.shortmess = vim.opt.shortmess + "c"
|
vim.opt.shortmess = vim.opt.shortmess + "c"
|
||||||
|
vim.opt.autochdir = true
|
||||||
vim.o.laststatus = 3
|
|
||||||
vim.o.cmdheight = 0 -- hides commandbar when not in use, looks ok
|
|
||||||
|
|
||||||
vim.opt.spelllang = 'en_us'
|
vim.opt.spelllang = 'en_us'
|
||||||
|
|
||||||
vim.g.python3_host_prog = '/home/frosty/.dotfiles/nvim/env/bin/python'
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command('W', 'write', {})
|
|
||||||
|
|
||||||
vim.opt.foldmethod = "expr"
|
vim.opt.foldmethod = "expr"
|
||||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
-- hit zc to enable folding
|
|
||||||
vim.o.foldenable = false
|
|
||||||
|
|
||||||
vim.g.neomake_open_list = 2
|
vim.o.foldenable = false
|
||||||
|
vim.o.laststatus = 3
|
||||||
|
vim.o.cmdheight = 0 -- hides commandbar when not in use, looks ok
|
||||||
|
vim.o.hidden = true
|
||||||
|
vim.o.signcolumn = 'auto'
|
||||||
|
-- vim.o.breakindent = false -- I think this looks bad
|
||||||
|
vim.o.errorbells = true
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
vim.o.mouse = 'a'
|
||||||
|
vim.o.mousemoveevent = true
|
||||||
|
vim.wo.cursorline = true
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command('W', 'write', {})
|
||||||
|
|
||||||
function map(mode, shortcut, command)
|
function map(mode, shortcut, command)
|
||||||
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
||||||
@@ -59,615 +55,33 @@ function imap(shortcut, command)
|
|||||||
map('i', shortcut, command)
|
map('i', shortcut, command)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.guifont = "Hack Nerd Font:h12"
|
nmap("<leader>ec", ':edit ' .. vim.fn.stdpath('config') .. '/init.lua<CR>')
|
||||||
if vim.g.neovide then
|
|
||||||
vim.g.neovide_refresh_rate = 140
|
|
||||||
-- change to whatever font you prefer
|
|
||||||
-- can check font with fc-cache on linux
|
|
||||||
vim.g.neovide_hide_mouse_when_typing = true
|
|
||||||
vim.g.neovide_refresh_rate_idle = 140
|
|
||||||
vim.g.neovide_scale_factor = 1.0
|
|
||||||
-- zoom with CTRL - and CTRL +
|
|
||||||
local change_scale_factor = function(delta)
|
|
||||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
|
|
||||||
end
|
|
||||||
vim.keymap.set("n", "<C-=>", function()
|
|
||||||
change_scale_factor(1.25)
|
|
||||||
end)
|
|
||||||
vim.keymap.set("n", "<C-->", function()
|
|
||||||
change_scale_factor(1 / 1.25)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- <leader> is leader key; default is \
|
|
||||||
nmap("<leader>v", "<cmd>NvimTreeToggle<cr>")
|
|
||||||
nmap("<leader>ec", "<cmd>e ~/.config/nvim/init.lua<cr>")
|
|
||||||
nmap("<leader>sc", "<cmd>source ~/.config/nvim/init.lua<cr><cmd>PackerClean<cr><cmd>PackerCompile<cr>")
|
|
||||||
|
|
||||||
-- buffer commands
|
|
||||||
nmap("<leader>b", "<cmd>BufferLineCyclePrev<cr>")
|
|
||||||
nmap("<leader>n", "<cmd>BufferLineCycleNext<cr>")
|
|
||||||
nmap("<leader>gb", "<cmd>BufferLinePick<cr>")
|
|
||||||
nmap("<leader>w", "<cmd>bdelete!<cr>")
|
|
||||||
nmap("<leader>f", "<cmd>Telescope live_grep<cr>")
|
|
||||||
-- toggle terminal in both modes
|
-- toggle terminal in both modes
|
||||||
nmap("<leader>t", "<cmd>FloatermToggle<cr>")
|
nmap("<leader>t", "<cmd>FloatermToggle<cr>")
|
||||||
map("t", "<leader>t", "<cmd>FloatermToggle<cr>")
|
map("t", "<leader>t", "<cmd>FloatermToggle<cr>")
|
||||||
|
|
||||||
nmap("<leader>dd", "<cmd>lua vim.diagnostic.open_float() <CR>")
|
nmap("<leader>dd", "<cmd>lua vim.diagnostic.open_float() <CR>")
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-a>", function()
|
-- Bootstrap lazy.nvim
|
||||||
require("dial.map").manipulate("increment", "normal")
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
end)
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
vim.keymap.set("n", "<C-x>", function()
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
require("dial.map").manipulate("decrement", "normal")
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
end)
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
local augroup = vim.api.nvim_create_augroup("Lspformatting", {})
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
-- lsp on_attach mappings
|
{ "\nPress any key to exit..." },
|
||||||
local on_attach = function(client, bufnr)
|
}, true, {})
|
||||||
if (not bufnr) then
|
vim.fn.getchar()
|
||||||
return
|
os.exit(1)
|
||||||
end
|
end
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
end
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Mappings.
|
require("lazy").setup({
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
spec = {
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
{ import = "plugins" }
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
},
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
checker = { enabled = true }
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>wl', function()
|
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
|
||||||
end, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
|
||||||
vim.keymap.set('n', '<space>f', '<cmd>lua vim.lsp.buf.format({ async = true })<CR>', bufopts)
|
|
||||||
|
|
||||||
-- require "coq".lsp_ensure_capabilities {}
|
|
||||||
require 'illuminate'.on_attach(client)
|
|
||||||
|
|
||||||
-- format on save does not work for python for some reason
|
|
||||||
if client.supports_method("textDocument/formatting") then
|
|
||||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format({
|
|
||||||
bufnr = bufnr,
|
|
||||||
})
|
})
|
||||||
end
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local lsp = require "lspconfig"
|
|
||||||
local lsp_defaults = lsp.util.default_config
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
capabilities.offsetEncoding = { "utf-16" }
|
|
||||||
|
|
||||||
lsp.clangd.setup { on_attach = on_attach, capabilities = capabilities }
|
|
||||||
lsp.ts_ls.setup { on_attach = on_attach, capabilities = capabilities }
|
|
||||||
lsp.hls.setup { on_attach = on_attach, capabilities = capabilities } -- haskell language server
|
|
||||||
lsp.pyright.setup { on_attach = on_attach, capabilities = capabilities }
|
|
||||||
lsp.svelte.setup { on_attach = on_attach, capabilities = capabilities }
|
|
||||||
lsp.marksman.setup { on_attach = on_attach, capabilities = capabilities }
|
|
||||||
lsp.rust_analyzer.setup { on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
checkOnSave = true,
|
|
||||||
check = {
|
|
||||||
enable = true,
|
|
||||||
command = "clippy",
|
|
||||||
features = "all"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lsp.lua_ls.setup { on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lsp.tailwindcss.setup { on_attach = on_attach,
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
|
|
||||||
lsp.julials.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_new_config = function(new_config, _)
|
|
||||||
local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia")
|
|
||||||
if lsp.util.path.is_file(julia) then
|
|
||||||
vim.notify("running julials")
|
|
||||||
new_config.cmd[1] = julia
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
on_attach = on_attach
|
|
||||||
}
|
|
||||||
|
|
||||||
-- kill eslint_d on exit
|
|
||||||
local on_leave_group = vim.api.nvim_create_augroup("OnLeaveGroup", {})
|
|
||||||
vim.api.nvim_create_autocmd("VimLeave", {
|
|
||||||
group = on_leave_group,
|
|
||||||
command = "silent !killall -q eslint_d",
|
|
||||||
})
|
|
||||||
|
|
||||||
--[[ local vertical_help = vim.api.nvim_create_augroup("vertical_help", {})
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = 'help',
|
|
||||||
group = vertical_help,
|
|
||||||
command = ":windcmd L"
|
|
||||||
})
|
|
||||||
]]
|
|
||||||
|
|
||||||
-- packer boilerplate
|
|
||||||
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
|
|
||||||
|
|
||||||
vim.cmd("colorscheme iceberg")
|
|
||||||
|
|
||||||
return require('packer').startup(function(use)
|
|
||||||
use 'wbthomason/packer.nvim'
|
|
||||||
use 'nvim-lua/plenary.nvim'
|
|
||||||
use 'neovim/nvim-lspconfig'
|
|
||||||
use {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
run = ':TSUpdate',
|
|
||||||
config = function()
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
highlight = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'echasnovski/mini.icons'
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'nvim-tree/nvim-web-devicons',
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'nvim-tree/nvim-tree.lua',
|
|
||||||
after = "nvim-web-devicons",
|
|
||||||
requires = "nvim-tree/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require('nvim-tree').setup {
|
|
||||||
hijack_cursor = true,
|
|
||||||
disable_netrw = true,
|
|
||||||
select_prompts = true,
|
|
||||||
renderer = {
|
|
||||||
add_trailing = true,
|
|
||||||
hidden_display = "all",
|
|
||||||
highlight_opened_files = "icon"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
requires = {
|
|
||||||
"hrsh7th/cmp-buffer", "hrsh7th/cmp-nvim-lsp",
|
|
||||||
"L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets",
|
|
||||||
'hrsh7th/cmp-nvim-lua', 'hrsh7th/cmp-path',
|
|
||||||
'hrsh7th/cmp-calc', 'hrsh7th/cmp-cmdline', 'f3fora/cmp-spell',
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local luasnip = require('luasnip')
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
sources = {
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'nvim_lsp', keyword_length = 1 },
|
|
||||||
{ name = 'buffer', keyword_length = 3 },
|
|
||||||
{ name = 'luasnip', keyword_length = 2 },
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered()
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
fields = { 'menu', 'abbr', 'kind' },
|
|
||||||
format = function(entry, item)
|
|
||||||
local menu_icon = {
|
|
||||||
nvim_lsp = 'λ',
|
|
||||||
luasnip = '⋗',
|
|
||||||
buffer = 'Ω',
|
|
||||||
path = '🖫',
|
|
||||||
}
|
|
||||||
|
|
||||||
item.menu = menu_icon[entry.source.name]
|
|
||||||
return item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
|
|
||||||
['<Down>'] = cmp.mapping.select_next_item(select_opts),
|
|
||||||
|
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
|
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
|
||||||
|
|
||||||
['<C-f>'] = cmp.mapping(function(fallback)
|
|
||||||
if luasnip.jumpable(1) then
|
|
||||||
luasnip.jump(1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
|
|
||||||
['<C-b>'] = cmp.mapping(function(fallback)
|
|
||||||
if luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.cmdline({ '/', '?' }, {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = {
|
|
||||||
{ name = 'buffer' }
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- to select something in the cmdline need to use <C-n>
|
|
||||||
cmp.setup.cmdline(':', {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'path' }
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
|
||||||
}),
|
|
||||||
matching = { disallow_symbol_nonprefix_matching = false }
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'nvimtools/none-ls.nvim',
|
|
||||||
config = function()
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
local lsp_conf = require("lspconfig")
|
|
||||||
|
|
||||||
-- util.root_pattern returns a function
|
|
||||||
local find_pyproject = lsp_conf.util.root_pattern('pyproject.toml')
|
|
||||||
local find_flake8 = lsp_conf.util.root_pattern('.flake8')
|
|
||||||
-- local find_eslint = lsp_conf.util.root_pattern('eslint.config.js')
|
|
||||||
|
|
||||||
local isort = null_ls.builtins.formatting.isort.with({
|
|
||||||
cwd = function(params)
|
|
||||||
return find_pyproject(params.root) or params.root
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
local black = null_ls.builtins.formatting.black.with({
|
|
||||||
cwd = function(params)
|
|
||||||
return find_pyproject(params.root) or params.root
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
local flake8 = require("none-ls.diagnostics.flake8").with({
|
|
||||||
cwd = function(params)
|
|
||||||
return find_flake8(params.root) or params.root
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
local eslint_format = require("none-ls.formatting.eslint_d").with({
|
|
||||||
extra_filetypes = { "svelte" },
|
|
||||||
})
|
|
||||||
|
|
||||||
local eslint_diag = require("none-ls.diagnostics.eslint_d").with({
|
|
||||||
extra_filetypes = { "svelte" },
|
|
||||||
})
|
|
||||||
|
|
||||||
local eslint_code_actions = require("none-ls.code_actions.eslint_d").with({
|
|
||||||
extra_filetypes = { "svelte" },
|
|
||||||
})
|
|
||||||
|
|
||||||
local spellcheck = null_ls.builtins.completion.spell.with({
|
|
||||||
filetypes = { "markdown" }
|
|
||||||
})
|
|
||||||
|
|
||||||
null_ls.setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
sources = {
|
|
||||||
eslint_format,
|
|
||||||
eslint_diag,
|
|
||||||
eslint_code_actions,
|
|
||||||
null_ls.builtins.code_actions.gitsigns,
|
|
||||||
null_ls.builtins.completion.luasnip,
|
|
||||||
null_ls.builtins.completion.tags,
|
|
||||||
spellcheck,
|
|
||||||
flake8,
|
|
||||||
isort,
|
|
||||||
black,
|
|
||||||
flake8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
requires = { "nvim-lua/plenary.nvim",
|
|
||||||
"nvimtools/none-ls-extras.nvim"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'folke/trouble.nvim',
|
|
||||||
config = function()
|
|
||||||
require("trouble").setup {
|
|
||||||
nmap("<leader>xx", "<cmd>Trouble<cr>"),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"hedyhli/outline.nvim",
|
|
||||||
config = function()
|
|
||||||
nmap("<leader>o", "<cmd>Outline<CR>")
|
|
||||||
require("outline").setup {
|
|
||||||
-- Your setup opts here (leave empty to use defaults)
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'akinsho/bufferline.nvim',
|
|
||||||
tag = "*",
|
|
||||||
requires = 'nvim-tree/nvim-web-devicons',
|
|
||||||
config = function()
|
|
||||||
require("bufferline").setup {
|
|
||||||
options = {
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "NvimTree",
|
|
||||||
text = "Neovim - Files",
|
|
||||||
highlight = "Directory",
|
|
||||||
separator = true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
separator_style = "slope",
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
config = function()
|
|
||||||
require("lualine").setup {
|
|
||||||
extensions = { 'nvim-tree', 'fzf', 'symbols-outline' },
|
|
||||||
options = {
|
|
||||||
component_separators = '',
|
|
||||||
section_separators = { left = '', right = '' },
|
|
||||||
theme = 'iceberg_dark',
|
|
||||||
globalstatus = true,
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
-- would be nice to open code actions but w/e
|
|
||||||
lualine_b = {
|
|
||||||
{
|
|
||||||
'diff',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_c = {
|
|
||||||
{
|
|
||||||
'diagnostics',
|
|
||||||
sources = { 'nvim_diagnostic', 'nvim_lsp' },
|
|
||||||
sections = { 'hint', 'warn', 'error' },
|
|
||||||
colored = true,
|
|
||||||
update_in_insert = true,
|
|
||||||
always_visible = false,
|
|
||||||
on_click = function()
|
|
||||||
require("trouble").toggle("diagnostics")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lualine_x = { 'filetype' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true }
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"startup-nvim/startup.nvim",
|
|
||||||
after = "nvim-web-devicons",
|
|
||||||
requires = {
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local startup = require("startup")
|
|
||||||
local headers = require("startup.headers")
|
|
||||||
local start_fn = require("startup.functions")
|
|
||||||
startup.setup({
|
|
||||||
banner = {
|
|
||||||
type = "text",
|
|
||||||
align = "center",
|
|
||||||
title = "Header",
|
|
||||||
content = headers.hydra_header,
|
|
||||||
highlight = "Statement",
|
|
||||||
},
|
|
||||||
quote = {
|
|
||||||
type = "text",
|
|
||||||
align = "center",
|
|
||||||
fold_section = false,
|
|
||||||
title = "Quote",
|
|
||||||
margin = 5,
|
|
||||||
content = require("startup.functions").quote(),
|
|
||||||
highlight = "Constant",
|
|
||||||
default_color = "",
|
|
||||||
},
|
|
||||||
body = {
|
|
||||||
type = "mapping",
|
|
||||||
align = "center",
|
|
||||||
fold_section = false,
|
|
||||||
title = "Basic Commands",
|
|
||||||
margin = 5,
|
|
||||||
content = {
|
|
||||||
{ " New File", "lua require'startup'.new_file()", "<leader>nf" },
|
|
||||||
{ " Recent Files", "Telescope oldfiles", "<leader>of" },
|
|
||||||
{ " Find File", "Telescope find_files", "<leader>ff" },
|
|
||||||
},
|
|
||||||
highlight = "String",
|
|
||||||
default_color = "",
|
|
||||||
},
|
|
||||||
plugin_info = {
|
|
||||||
type = "text",
|
|
||||||
content = require("startup.functions").packer_plugins(),
|
|
||||||
align = "center",
|
|
||||||
fold_section = false,
|
|
||||||
title = "",
|
|
||||||
margin = 5,
|
|
||||||
highlight = "TSString",
|
|
||||||
default_color = "#FFFFFF",
|
|
||||||
},
|
|
||||||
options = {
|
|
||||||
mapping_keys = true,
|
|
||||||
},
|
|
||||||
parts = { "banner", "quote", "body", "plugin_info" }
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use 'RRethy/vim-illuminate'
|
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
requires = { 'nvim-lua/plenary.nvim' },
|
|
||||||
config = function()
|
|
||||||
require("telescope").setup {}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'j-hui/fidget.nvim',
|
|
||||||
config = function()
|
|
||||||
require('fidget').setup {}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use 'voldikss/vim-floaterm'
|
|
||||||
use { 'norcalli/nvim-colorizer.lua',
|
|
||||||
config = function()
|
|
||||||
require('colorizer').setup {
|
|
||||||
'css',
|
|
||||||
'scss',
|
|
||||||
'javascript',
|
|
||||||
'toml'
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
use { 'lewis6991/gitsigns.nvim',
|
|
||||||
config = function()
|
|
||||||
require('gitsigns').setup {
|
|
||||||
on_attach = function()
|
|
||||||
nmap('<leader>hd', '<cmd>Gitsigns diffthis<cr>')
|
|
||||||
nmap('<leader>hr', '<cmd>Gitsigns reset_hunk<cr>')
|
|
||||||
nmap('<leader>td', '<cmd>Gitsigns toggle_deleted<cr>')
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use { 'sudormrfbin/cheatsheet.nvim',
|
|
||||||
-- default toggle is <leader>?
|
|
||||||
requires = {
|
|
||||||
{ 'nvim-telescope/telescope.nvim' },
|
|
||||||
{ 'nvim-lua/popup.nvim' },
|
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
use { 'stevearc/dressing.nvim' }
|
|
||||||
if packer_bootstrap then
|
|
||||||
require('packer').sync()
|
|
||||||
end
|
|
||||||
use {
|
|
||||||
"danymat/neogen",
|
|
||||||
config = function()
|
|
||||||
local neogen = require('neogen')
|
|
||||||
neogen.setup({
|
|
||||||
snippet_engine = "luasnip",
|
|
||||||
placeholders_hl = "None" -- fixes weird bug where the entire page gets colored with this color
|
|
||||||
})
|
|
||||||
nmap('<leader>d', ":lua require('neogen').generate()<CR>")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
config = function()
|
|
||||||
local which_key = require('which-key')
|
|
||||||
which_key.setup({
|
|
||||||
preset = "modern"
|
|
||||||
})
|
|
||||||
end
|
|
||||||
,
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'numToStr/Comment.nvim',
|
|
||||||
config = function()
|
|
||||||
require('Comment').setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use({
|
|
||||||
"kylechui/nvim-surround",
|
|
||||||
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
||||||
config = function()
|
|
||||||
require("nvim-surround").setup({
|
|
||||||
-- Configuration here, or leave empty to use defaults
|
|
||||||
})
|
|
||||||
end
|
|
||||||
})
|
|
||||||
use {
|
|
||||||
'pwntester/octo.nvim',
|
|
||||||
requires = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
'nvim-tree/nvim-web-devicons',
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require "octo".setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"monaqa/dial.nvim",
|
|
||||||
config = function()
|
|
||||||
local augend = require("dial.augend")
|
|
||||||
local dial = require("dial.config")
|
|
||||||
local d_map = require("dial.map")
|
|
||||||
|
|
||||||
dial.augends:register_group {
|
|
||||||
default = {
|
|
||||||
augend.integer.alias.decimal,
|
|
||||||
augend.date.alias["%m/%d"],
|
|
||||||
augend.constant.alias.alpha,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use "cocopon/iceberg.vim"
|
|
||||||
end)
|
|
||||||
|
|||||||
@@ -0,0 +1,672 @@
|
|||||||
|
-- some basic options
|
||||||
|
local vim = vim
|
||||||
|
local fn = vim.fn
|
||||||
|
|
||||||
|
-- nvim tree said to disable netrw
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.smarttab = true
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.o.hidden = true
|
||||||
|
vim.o.signcolumn = 'auto'
|
||||||
|
-- vim.o.breakindent = false -- I think this looks bad
|
||||||
|
vim.o.errorbells = true
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
vim.g.noswapfile = true
|
||||||
|
vim.cmd [[set mouse=a]] -- enable mouse
|
||||||
|
vim.wo.cursorline = true
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.wrap = true
|
||||||
|
vim.opt.linebreak = true
|
||||||
|
vim.opt.showmatch = true
|
||||||
|
vim.opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' }
|
||||||
|
vim.opt.shortmess = vim.opt.shortmess + "c"
|
||||||
|
vim.opt.autochdir = true
|
||||||
|
|
||||||
|
vim.o.laststatus = 3
|
||||||
|
vim.o.cmdheight = 0 -- hides commandbar when not in use, looks ok
|
||||||
|
|
||||||
|
vim.opt.spelllang = 'en_us'
|
||||||
|
|
||||||
|
vim.g.python3_host_prog = fn.exepath("python3")
|
||||||
|
vim.api.nvim_create_user_command('W', 'write', {})
|
||||||
|
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
-- hit zc to enable folding
|
||||||
|
vim.o.foldenable = false
|
||||||
|
|
||||||
|
vim.g.neomake_open_list = 2
|
||||||
|
|
||||||
|
function map(mode, shortcut, command)
|
||||||
|
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- normal mode map
|
||||||
|
function nmap(shortcut, command)
|
||||||
|
map('n', shortcut, command)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- insert mode map
|
||||||
|
function imap(shortcut, command)
|
||||||
|
map('i', shortcut, command)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.guifont = "Hack Nerd Font:h12"
|
||||||
|
if vim.g.neovide then
|
||||||
|
vim.g.neovide_refresh_rate = 140
|
||||||
|
-- change to whatever font you prefer
|
||||||
|
-- can check font with fc-cache on linux
|
||||||
|
vim.g.neovide_hide_mouse_when_typing = true
|
||||||
|
vim.g.neovide_refresh_rate_idle = 140
|
||||||
|
vim.g.neovide_scale_factor = 1.0
|
||||||
|
-- zoom with CTRL - and CTRL +
|
||||||
|
local change_scale_factor = function(delta)
|
||||||
|
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
|
||||||
|
end
|
||||||
|
vim.keymap.set("n", "<C-=>", function()
|
||||||
|
change_scale_factor(1.25)
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<C-->", function()
|
||||||
|
change_scale_factor(1 / 1.25)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- <leader> is leader key; default is \
|
||||||
|
nmap("<leader>v", "<cmd>NvimTreeToggle<cr>")
|
||||||
|
nmap("<leader>ec", "<cmd>e ~/.config/nvim/init.lua<cr>")
|
||||||
|
nmap("<leader>sc", "<cmd>source ~/.config/nvim/init.lua<cr><cmd>PackerClean<cr><cmd>PackerCompile<cr>")
|
||||||
|
|
||||||
|
-- buffer commands
|
||||||
|
nmap("<leader>b", "<cmd>BufferLineCyclePrev<cr>")
|
||||||
|
nmap("<leader>n", "<cmd>BufferLineCycleNext<cr>")
|
||||||
|
nmap("<leader>gb", "<cmd>BufferLinePick<cr>")
|
||||||
|
nmap("<leader>w", "<cmd>bdelete!<cr>")
|
||||||
|
nmap("<leader>f", "<cmd>Telescope live_grep<cr>")
|
||||||
|
-- toggle terminal in both modes
|
||||||
|
nmap("<leader>t", "<cmd>FloatermToggle<cr>")
|
||||||
|
map("t", "<leader>t", "<cmd>FloatermToggle<cr>")
|
||||||
|
|
||||||
|
nmap("<leader>dd", "<cmd> lua vim.diagnostic.open_float() <CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<C-a>", function()
|
||||||
|
require("dial.map").manipulate("increment", "normal")
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<C-x>", function()
|
||||||
|
require("dial.map").manipulate("decrement", "normal")
|
||||||
|
end)
|
||||||
|
|
||||||
|
local augroup = vim.api.nvim_create_augroup("Lspformatting", {})
|
||||||
|
|
||||||
|
-- lsp on_attach mappings
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
if (not bufnr) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>f', '<cmd>lua vim.lsp.buf.format({ async = true })<CR>', bufopts)
|
||||||
|
|
||||||
|
-- require "coq".lsp_ensure_capabilities {}
|
||||||
|
require 'illuminate'.on_attach(client)
|
||||||
|
|
||||||
|
-- format on save does not work for python for some reason
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({
|
||||||
|
bufnr = bufnr,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp = require "lspconfig"
|
||||||
|
local lsp_defaults = lsp.util.default_config
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
|
|
||||||
|
lsp.clangd.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.ts_ls.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.hls.setup { on_attach = on_attach, capabilities = capabilities } -- haskell language server
|
||||||
|
-- lsp.pyright.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.ruff.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.svelte.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.marksman.setup { on_attach = on_attach, capabilities = capabilities }
|
||||||
|
lsp.rust_analyzer.setup { on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = true,
|
||||||
|
check = {
|
||||||
|
enable = true,
|
||||||
|
command = "clippy",
|
||||||
|
features = "all"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lsp.lua_ls.setup { on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lsp.tailwindcss.setup { on_attach = on_attach,
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
|
lsp.julials.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_new_config = function(new_config, _)
|
||||||
|
local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia")
|
||||||
|
if lsp.util.path.is_file(julia) then
|
||||||
|
vim.notify("running julials")
|
||||||
|
new_config.cmd[1] = julia
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
|
||||||
|
-- kill eslint_d on exit
|
||||||
|
local on_leave_group = vim.api.nvim_create_augroup("OnLeaveGroup", {})
|
||||||
|
vim.api.nvim_create_autocmd("VimLeave", {
|
||||||
|
group = on_leave_group,
|
||||||
|
command = "silent !killall -q eslint_d",
|
||||||
|
})
|
||||||
|
|
||||||
|
--[[ local vertical_help = vim.api.nvim_create_augroup("vertical_help", {})
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = 'help',
|
||||||
|
group = vertical_help,
|
||||||
|
command = ":windcmd L"
|
||||||
|
})
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- packer boilerplate
|
||||||
|
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
|
||||||
|
|
||||||
|
vim.cmd("colorscheme carbonfox")
|
||||||
|
|
||||||
|
return require('packer').startup(function(use)
|
||||||
|
use 'wbthomason/packer.nvim'
|
||||||
|
use 'nvim-lua/plenary.nvim'
|
||||||
|
use 'neovim/nvim-lspconfig'
|
||||||
|
use {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
run = ':TSUpdate',
|
||||||
|
config = function()
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'echasnovski/mini.icons'
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
after = "nvim-web-devicons",
|
||||||
|
requires = "nvim-tree/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require('nvim-tree').setup {
|
||||||
|
hijack_cursor = true,
|
||||||
|
disable_netrw = true,
|
||||||
|
select_prompts = true,
|
||||||
|
renderer = {
|
||||||
|
add_trailing = true,
|
||||||
|
hidden_display = "all",
|
||||||
|
highlight_opened_files = "icon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
requires = {
|
||||||
|
"hrsh7th/cmp-buffer", "hrsh7th/cmp-nvim-lsp",
|
||||||
|
"L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets",
|
||||||
|
'hrsh7th/cmp-nvim-lua', 'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-calc', 'hrsh7th/cmp-cmdline', 'f3fora/cmp-spell',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'nvim_lsp', keyword_length = 1 },
|
||||||
|
{ name = 'buffer', keyword_length = 3 },
|
||||||
|
{ name = 'luasnip', keyword_length = 2 },
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered()
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { 'menu', 'abbr', 'kind' },
|
||||||
|
format = function(entry, item)
|
||||||
|
local menu_icon = {
|
||||||
|
nvim_lsp = 'λ',
|
||||||
|
luasnip = '⋗',
|
||||||
|
buffer = 'Ω',
|
||||||
|
path = '🖫',
|
||||||
|
}
|
||||||
|
|
||||||
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
return item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
['<Down>'] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
['<C-f>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
|
['<C-b>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- to select something in the cmdline need to use <C-n>
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
}),
|
||||||
|
matching = { disallow_symbol_nonprefix_matching = false }
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'nvimtools/none-ls.nvim',
|
||||||
|
config = function()
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local lsp_conf = require("lspconfig")
|
||||||
|
|
||||||
|
-- util.root_pattern returns a function
|
||||||
|
local find_pyproject = lsp_conf.util.root_pattern('pyproject.toml')
|
||||||
|
local black = null_ls.builtins.formatting.black
|
||||||
|
|
||||||
|
local eslint_format = require("none-ls.formatting.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local eslint_diag = require("none-ls.diagnostics.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local eslint_code_actions = require("none-ls.code_actions.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local spellcheck = null_ls.builtins.completion.spell.with({
|
||||||
|
filetypes = { "markdown" }
|
||||||
|
})
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
sources = {
|
||||||
|
eslint_format,
|
||||||
|
eslint_diag,
|
||||||
|
eslint_code_actions,
|
||||||
|
null_ls.builtins.code_actions.gitsigns,
|
||||||
|
null_ls.builtins.completion.luasnip,
|
||||||
|
null_ls.builtins.completion.tags,
|
||||||
|
spellcheck,
|
||||||
|
--flake8,
|
||||||
|
--isort,
|
||||||
|
black,
|
||||||
|
--flake8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
requires = { "nvim-lua/plenary.nvim",
|
||||||
|
"nvimtools/none-ls-extras.nvim"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
config = function()
|
||||||
|
require("trouble").setup {
|
||||||
|
nmap("<leader>xx", "<cmd>Trouble<cr>"),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"hedyhli/outline.nvim",
|
||||||
|
config = function()
|
||||||
|
nmap("<leader>o", "<cmd>Outline<CR>")
|
||||||
|
require("outline").setup {
|
||||||
|
-- Your setup opts here (leave empty to use defaults)
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'akinsho/bufferline.nvim',
|
||||||
|
tag = "*",
|
||||||
|
requires = 'nvim-tree/nvim-web-devicons',
|
||||||
|
config = function()
|
||||||
|
require("bufferline").setup {
|
||||||
|
options = {
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "NvimTree",
|
||||||
|
text = "Neovim - Files",
|
||||||
|
highlight = "Directory",
|
||||||
|
separator = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
separator_style = "slope",
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
config = function()
|
||||||
|
require("lualine").setup {
|
||||||
|
extensions = { 'nvim-tree', 'fzf', 'symbols-outline' },
|
||||||
|
options = {
|
||||||
|
component_separators = '',
|
||||||
|
section_separators = { left = '', right = '' },
|
||||||
|
theme = 'iceberg_dark',
|
||||||
|
globalstatus = true,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
-- would be nice to open code actions but w/e
|
||||||
|
lualine_b = {
|
||||||
|
{
|
||||||
|
'diff',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
'diagnostics',
|
||||||
|
sources = { 'nvim_diagnostic', 'nvim_lsp' },
|
||||||
|
sections = { 'hint', 'warn', 'error' },
|
||||||
|
colored = true,
|
||||||
|
update_in_insert = true,
|
||||||
|
always_visible = false,
|
||||||
|
on_click = function()
|
||||||
|
require("trouble").toggle("diagnostics")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lualine_x = { 'filetype' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
requires = { 'nvim-tree/nvim-web-devicons', opt = true }
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"startup-nvim/startup.nvim",
|
||||||
|
after = "nvim-web-devicons",
|
||||||
|
requires = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
"nvim-lua/plenary.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local startup = require("startup")
|
||||||
|
local headers = require("startup.headers")
|
||||||
|
local start_fn = require("startup.functions")
|
||||||
|
startup.setup({
|
||||||
|
banner = {
|
||||||
|
type = "text",
|
||||||
|
align = "center",
|
||||||
|
title = "Header",
|
||||||
|
content = headers.hydra_header,
|
||||||
|
highlight = "Statement",
|
||||||
|
},
|
||||||
|
quote = {
|
||||||
|
type = "text",
|
||||||
|
align = "center",
|
||||||
|
fold_section = false,
|
||||||
|
title = "Quote",
|
||||||
|
margin = 5,
|
||||||
|
content = require("startup.functions").quote(),
|
||||||
|
highlight = "Constant",
|
||||||
|
default_color = "",
|
||||||
|
},
|
||||||
|
body = {
|
||||||
|
type = "mapping",
|
||||||
|
align = "center",
|
||||||
|
fold_section = false,
|
||||||
|
title = "Basic Commands",
|
||||||
|
margin = 5,
|
||||||
|
content = {
|
||||||
|
{ " New File", "lua require'startup'.new_file()", "<leader>nf" },
|
||||||
|
{ " Recent Files", "Telescope oldfiles", "<leader>of" },
|
||||||
|
{ " Find File", "Telescope find_files", "<leader>ff" },
|
||||||
|
},
|
||||||
|
highlight = "String",
|
||||||
|
default_color = "",
|
||||||
|
},
|
||||||
|
plugin_info = {
|
||||||
|
type = "text",
|
||||||
|
content = require("startup.functions").packer_plugins(),
|
||||||
|
align = "center",
|
||||||
|
fold_section = false,
|
||||||
|
title = "",
|
||||||
|
margin = 5,
|
||||||
|
highlight = "TSString",
|
||||||
|
default_color = "#FFFFFF",
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
mapping_keys = true,
|
||||||
|
},
|
||||||
|
parts = { "banner", "quote", "body", "plugin_info" }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use 'RRethy/vim-illuminate'
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
requires = { 'nvim-lua/plenary.nvim' },
|
||||||
|
config = function()
|
||||||
|
require("telescope").setup {}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
|
config = function()
|
||||||
|
require('fidget').setup {}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use 'voldikss/vim-floaterm'
|
||||||
|
use { 'norcalli/nvim-colorizer.lua',
|
||||||
|
config = function()
|
||||||
|
require('colorizer').setup {
|
||||||
|
'css',
|
||||||
|
'scss',
|
||||||
|
'javascript',
|
||||||
|
'toml'
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
use { 'lewis6991/gitsigns.nvim',
|
||||||
|
config = function()
|
||||||
|
require('gitsigns').setup {
|
||||||
|
on_attach = function()
|
||||||
|
nmap('<leader>hd', '<cmd>Gitsigns diffthis<cr>')
|
||||||
|
nmap('<leader>hr', '<cmd>Gitsigns reset_hunk<cr>')
|
||||||
|
nmap('<leader>td', '<cmd>Gitsigns toggle_deleted<cr>')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use { 'sudormrfbin/cheatsheet.nvim',
|
||||||
|
-- default toggle is <leader>?
|
||||||
|
requires = {
|
||||||
|
{ 'nvim-telescope/telescope.nvim' },
|
||||||
|
{ 'nvim-lua/popup.nvim' },
|
||||||
|
{ 'nvim-lua/plenary.nvim' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
use { 'stevearc/dressing.nvim' }
|
||||||
|
if packer_bootstrap then
|
||||||
|
require('packer').sync()
|
||||||
|
end
|
||||||
|
use {
|
||||||
|
"danymat/neogen",
|
||||||
|
config = function()
|
||||||
|
local neogen = require('neogen')
|
||||||
|
neogen.setup({
|
||||||
|
snippet_engine = "luasnip",
|
||||||
|
placeholders_hl = "None", -- fixes weird bug where the entire page gets colored with this color
|
||||||
|
languages = {
|
||||||
|
python = {
|
||||||
|
template = {
|
||||||
|
annotation_convention = "google_docstrings"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
nmap('<leader>d', ":lua require('neogen').generate()<CR>")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
local which_key = require('which-key')
|
||||||
|
which_key.setup({
|
||||||
|
preset = "modern"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
,
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
|
config = function()
|
||||||
|
require('Comment').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use({
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup({
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
use {
|
||||||
|
'pwntester/octo.nvim',
|
||||||
|
requires = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require "octo".setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
"monaqa/dial.nvim",
|
||||||
|
config = function()
|
||||||
|
local augend = require("dial.augend")
|
||||||
|
local dial = require("dial.config")
|
||||||
|
local d_map = require("dial.map")
|
||||||
|
|
||||||
|
dial.augends:register_group {
|
||||||
|
default = {
|
||||||
|
augend.integer.alias.decimal,
|
||||||
|
augend.date.alias["%m/%d"],
|
||||||
|
augend.constant.alias.alpha,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
use "EdenEast/nightfox.nvim"
|
||||||
|
--[[ use {
|
||||||
|
"benlubas/molten-nvim",
|
||||||
|
requires = { "3rd/image.nvim" },
|
||||||
|
config = function()
|
||||||
|
vim.g.molten_image_provider = "image.nvim"
|
||||||
|
vim.g.molten_output_win_max_height = 20
|
||||||
|
nmap("<leader>q", "<cmd>MoltenEvaluateLine<cr>")
|
||||||
|
nmap("<leader>os", "<cmd>MoltenEnterOutput<cr>")
|
||||||
|
end,
|
||||||
|
} ]]
|
||||||
|
end)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
|
||||||
|
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||||
|
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||||
|
"neogen": { "branch": "main", "commit": "d7f9461727751fb07f82011051338a9aba07581d" },
|
||||||
|
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
|
||||||
|
"none-ls-extras.nvim": { "branch": "main", "commit": "52628966ffc5b49cf0dbbe4d8733bacede9e7e8b" },
|
||||||
|
"none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
|
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "d89f4891f0720cd2598e4bdd60010d8784b2ac8a" },
|
||||||
|
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
|
||||||
|
"outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||||
|
"vim-floaterm": { "branch": "master", "commit": "fd4bdd66eca56c6cc59f2119e4447496d8cde2ea" },
|
||||||
|
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
{
|
||||||
|
'RRethy/vim-illuminate',
|
||||||
|
event = 'LspAttach'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'voldikss/vim-floaterm',
|
||||||
|
cmd = 'FloatermToggle',
|
||||||
|
},
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
|
'echasnovski/mini.icons',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
|
'kylechui/nvim-surround',
|
||||||
|
'stevearc/dressing.nvim',
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
opts = {
|
||||||
|
highlight = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
dependencies = "nvim-tree/nvim-web-devicons",
|
||||||
|
init = function()
|
||||||
|
-- disables netrw
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
hijack_cursor = true,
|
||||||
|
disable_netrw = true,
|
||||||
|
select_prompts = true,
|
||||||
|
renderer = {
|
||||||
|
add_trailing = true,
|
||||||
|
hidden_display = "all",
|
||||||
|
highlight_opened_files = "icon"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>v", "<cmd>NvimTreeToggle<cr>" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = { preset = "modern" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hedyhli/outline.nvim",
|
||||||
|
event = "LspAttach",
|
||||||
|
cmd = { "Outline", "OutlineOpen" },
|
||||||
|
keys = {
|
||||||
|
{ "<leader>o", "<cmd>Outline<CR>", desc = "Show outline" }
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- https://github.com/hedyhli/outline.nvim
|
||||||
|
-- setup call required for this to work!
|
||||||
|
require("outline").setup {}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ff", "<cmd>Telescope live_grep<cr>", desc = "Fuzzy grep across workspace" },
|
||||||
|
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Find buffer" },
|
||||||
|
{ "<leader>fp", "<cmd>lua require'telescope.builtin'.git_files{}<cr>", desc="Find in project"},
|
||||||
|
{ "<leader>p", "<cmd>Telescope diagnostics<cr>", desc = "Show diagnostics for buffer"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'catgoose/nvim-colorizer.lua',
|
||||||
|
opts = {
|
||||||
|
'css',
|
||||||
|
'scss',
|
||||||
|
'javascript',
|
||||||
|
'toml',
|
||||||
|
'python'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
keys = {
|
||||||
|
{ '<leader>hd', '<cmd>Gitsigns diffthis<cr>', desc = "Show Git diff" },
|
||||||
|
{ '<leader>hr', '<cmd>Gitsigns reset_hunk<cr>', desc = "Git reset hunk" },
|
||||||
|
{ '<leader>td', '<cmd>Gitsigns toggle_deleted<cr>', desc = 'Git toggle deleted' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'sudormrfbin/cheatsheet.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
'nvim-lua/popup.nvim',
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
--[[{
|
||||||
|
'pwntester/octo.nvim',
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
},
|
||||||
|
}]]
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
return {
|
||||||
|
'akinsho/bufferline.nvim',
|
||||||
|
version = "*",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||||
|
config = function()
|
||||||
|
local bufferline = require('bufferline')
|
||||||
|
|
||||||
|
bufferline.setup({
|
||||||
|
options = {
|
||||||
|
style_preset = bufferline.style_preset.no_italic,
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "NvimTree",
|
||||||
|
text = "Files",
|
||||||
|
highlight = "Directory",
|
||||||
|
separator = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
hover = {
|
||||||
|
enabled = true,
|
||||||
|
delay = 0,
|
||||||
|
reveal = { 'close' }
|
||||||
|
},
|
||||||
|
show_close_icon = false,
|
||||||
|
separator_style = "slope",
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>b", "<cmd>BufferLineCyclePrev<cr>", desc = "Go to previous tab" },
|
||||||
|
{ "<leader>n", "<cmd>BufferLineCycleNext<cr>", desc = "Go to next tab" },
|
||||||
|
{ "<leader>gb", "<cmd>BufferLinePick<cr>", desc = "Pick tab" },
|
||||||
|
{ "<leader>w", "<cmd>bdelete!<cr>", desc = "Close tab" }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"EdenEast/nightfox.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("nightfox").setup({
|
||||||
|
palettes = {
|
||||||
|
carbonfox = {
|
||||||
|
bg1 = "#0C0C0C",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
vim.cmd.colorscheme("carbonfox")
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
local augroup = vim.api.nvim_create_augroup("Lspformatting", {})
|
||||||
|
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
if (not bufnr) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require 'illuminate'.on_attach(client)
|
||||||
|
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>f', '<cmd>lua vim.lsp.buf.format({ async = true })<CR>', bufopts)
|
||||||
|
|
||||||
|
-- format on save does not work for python for some reason
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({
|
||||||
|
async = false,
|
||||||
|
bufnr = bufnr,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local on_leave_group = vim.api.nvim_create_augroup("OnLeaveGroup", {})
|
||||||
|
vim.api.nvim_create_autocmd("VimLeave", {
|
||||||
|
group = on_leave_group,
|
||||||
|
command = "silent !killall -q eslint_d",
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return { {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
'RRethy/vim-illuminate',
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local lsp = require("lspconfig")
|
||||||
|
local lspconfig_defaults = lsp.util.default_config
|
||||||
|
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||||
|
'force',
|
||||||
|
lspconfig_defaults.capabilities,
|
||||||
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
)
|
||||||
|
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
|
lsp.lua_ls.setup({
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.clangd.setup { on_attach = on_attach }
|
||||||
|
lsp.ts_ls.setup { on_attach = on_attach } -- typescript
|
||||||
|
lsp.hls.setup { on_attach = on_attach } -- haskell
|
||||||
|
lsp.pyright.setup { on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
pyright = {
|
||||||
|
disableOrganizeImports = true, -- Using Ruff
|
||||||
|
},
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
ignore = { '*' }, -- Using Ruff
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
lsp.ruff.setup { on_attach = on_attach }
|
||||||
|
lsp.svelte.setup { on_attach = on_attach }
|
||||||
|
lsp.marksman.setup { on_attach = on_attach }
|
||||||
|
lsp.rust_analyzer.setup { on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = true,
|
||||||
|
check = {
|
||||||
|
enable = true,
|
||||||
|
command = "clippy",
|
||||||
|
features = "all"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lsp.tailwindcss.setup { on_attach = on_attach }
|
||||||
|
|
||||||
|
lsp.julials.setup {
|
||||||
|
on_new_config = function(new_config, _)
|
||||||
|
local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia")
|
||||||
|
if lsp.util.path.is_file(julia) then
|
||||||
|
vim.notify("running julials")
|
||||||
|
new_config.cmd[1] = julia
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvimtools/none-ls.nvim',
|
||||||
|
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
config = function()
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
--capabilities.offsetEncoding = { "utf-16" }
|
||||||
|
|
||||||
|
local eslint_format = require("none-ls.formatting.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local eslint_diag = require("none-ls.diagnostics.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
local eslint_code_actions = require("none-ls.code_actions.eslint_d").with({
|
||||||
|
extra_filetypes = { "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
sources = {
|
||||||
|
eslint_format,
|
||||||
|
eslint_diag,
|
||||||
|
eslint_code_actions,
|
||||||
|
null_ls.builtins.code_actions.gitsigns,
|
||||||
|
null_ls.builtins.completion.luasnip,
|
||||||
|
null_ls.builtins.completion.tags,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim",
|
||||||
|
"nvimtools/none-ls-extras.nvim",
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
extensions = { 'nvim-tree', 'fzf', 'symbols-outline' },
|
||||||
|
options = {
|
||||||
|
component_separators = '',
|
||||||
|
section_separators = { left = '', right = '' },
|
||||||
|
theme = 'auto',
|
||||||
|
globalstatus = true,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
-- would be nice to open code actions but w/e
|
||||||
|
lualine_b = {
|
||||||
|
{
|
||||||
|
'branch',
|
||||||
|
'diff',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
'diagnostics',
|
||||||
|
sources = { 'nvim_diagnostic', 'nvim_lsp' },
|
||||||
|
sections = { 'hint', 'warn', 'error' },
|
||||||
|
colored = true,
|
||||||
|
update_in_insert = true,
|
||||||
|
always_visible = false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lualine_x = { 'filetype' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
"danymat/neogen",
|
||||||
|
config = function()
|
||||||
|
require("neogen").setup({
|
||||||
|
enabled = true,
|
||||||
|
snippet_engine = "luasnip",
|
||||||
|
placeholders_hl = "None", -- fixes weird bug where the entire page gets colored with this color
|
||||||
|
languages = {
|
||||||
|
python = {
|
||||||
|
template = {
|
||||||
|
annotation_convention = "google_docstrings"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
nmap('<leader>d', ":lua require('neogen').generate()<CR>")
|
||||||
|
end
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
build = "make install_jsregexp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-buffer", "hrsh7th/cmp-nvim-lsp",
|
||||||
|
"L3MON4D3/LuaSnip", "rafamadriz/friendly-snippets",
|
||||||
|
'hrsh7th/cmp-nvim-lua', 'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-calc', 'hrsh7th/cmp-cmdline', 'f3fora/cmp-spell',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'nvim_lsp', keyword_length = 1 },
|
||||||
|
{ name = 'buffer', keyword_length = 3 },
|
||||||
|
{ name = 'luasnip', keyword_length = 2 },
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered()
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { 'menu', 'abbr', 'kind' },
|
||||||
|
format = function(entry, item)
|
||||||
|
local menu_icon = {
|
||||||
|
nvim_lsp = 'λ',
|
||||||
|
luasnip = '⋗',
|
||||||
|
buffer = 'Ω',
|
||||||
|
path = '🖫',
|
||||||
|
}
|
||||||
|
|
||||||
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
return item
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
['<Down>'] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
['<C-f>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
|
['<C-b>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- to select something in the cmdline need to use <C-n>
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
}),
|
||||||
|
matching = { disallow_symbol_nonprefix_matching = false }
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
} }
|
||||||
@@ -0,0 +1,214 @@
|
|||||||
|
;==========================================================
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||||
|
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||||
|
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||||
|
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||||
|
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||||
|
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; To learn more about how to configure Polybar
|
||||||
|
; go to https://github.com/polybar/polybar
|
||||||
|
;
|
||||||
|
; The README contains a lot of information
|
||||||
|
;
|
||||||
|
;==========================================================
|
||||||
|
|
||||||
|
|
||||||
|
[colors]
|
||||||
|
background = ${xrdb:color0}
|
||||||
|
background-alt = #444
|
||||||
|
foreground = ${xrdb:color7}
|
||||||
|
foreground-alt = #555
|
||||||
|
primary = #ffb52a
|
||||||
|
secondary = #e60053
|
||||||
|
alert = #bd2c40
|
||||||
|
|
||||||
|
[bar/default]
|
||||||
|
monitor = ${env:MONITOR:}
|
||||||
|
|
||||||
|
width = 100%
|
||||||
|
height = 2.5%
|
||||||
|
bottom = true
|
||||||
|
offset-x = 0
|
||||||
|
offset-y = 0
|
||||||
|
radius = 0.0
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
background = ${colors.background}
|
||||||
|
foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
line-size = 0
|
||||||
|
line-color = #f00
|
||||||
|
|
||||||
|
border-size = 0
|
||||||
|
border-color = #00000000
|
||||||
|
|
||||||
|
padding-left = 0
|
||||||
|
padding-right = 1
|
||||||
|
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 1
|
||||||
|
|
||||||
|
font-0 = Hack:style=Regular:size=11;1
|
||||||
|
font-1 = unifont:style=Regular:size=11;0
|
||||||
|
font-2 = siji:style=Regular:size=11;1
|
||||||
|
|
||||||
|
modules-left = i3 title
|
||||||
|
modules-center = date
|
||||||
|
modules-right = cpu memory wlan pulseaudio battery
|
||||||
|
|
||||||
|
tray-position = right
|
||||||
|
tray-padding = 2
|
||||||
|
tray-scale = 1.0
|
||||||
|
;tray-background = #0063ff
|
||||||
|
;tray-reparent = true
|
||||||
|
;wm-restack = bspwm
|
||||||
|
wm-restack = i3
|
||||||
|
|
||||||
|
;override-redirect = true
|
||||||
|
|
||||||
|
;scroll-up = bspwm-desknext
|
||||||
|
;scroll-down = bspwm-deskprev
|
||||||
|
|
||||||
|
;scroll-up = i3wm-wsnext
|
||||||
|
;scroll-down = i3wm-wsprev
|
||||||
|
|
||||||
|
cursor-click = pointer
|
||||||
|
cursor-scroll = ns-resize
|
||||||
|
|
||||||
|
#[module/title]
|
||||||
|
#type = internal/xwindow
|
||||||
|
#label-maxlen = 25
|
||||||
|
|
||||||
|
[module/cpu]
|
||||||
|
type = internal/cpu
|
||||||
|
interval = 2
|
||||||
|
format-prefix = "CPU:"
|
||||||
|
format-prefix-foreground = ${xrdb:color7}
|
||||||
|
format-underline =
|
||||||
|
label = %percentage:2%%
|
||||||
|
|
||||||
|
[module/memory]
|
||||||
|
type = internal/memory
|
||||||
|
interval = 2
|
||||||
|
format-prefix = ""
|
||||||
|
format-prefix-foreground = ${xrdb:color7}
|
||||||
|
format-underline =
|
||||||
|
label = %gb_used% | %gb_free%
|
||||||
|
|
||||||
|
[module/wlan]
|
||||||
|
type = internal/network
|
||||||
|
interface = wlan0
|
||||||
|
interval = 3.0
|
||||||
|
|
||||||
|
format-connected = <label-connected>
|
||||||
|
format-connected-underline =
|
||||||
|
label-connected =
|
||||||
|
label-disconnected = "No connection"
|
||||||
|
;format-disconnected = <label-disconnected>
|
||||||
|
;format-disconnected-underline = ${self.format-connected-underline}
|
||||||
|
;label-disconnected = %ifname% disconnected
|
||||||
|
;label-disconnected-foreground = ${colors.foreground-alt}
|
||||||
|
|
||||||
|
ramp-signal-0 =
|
||||||
|
ramp-signal-1 =
|
||||||
|
ramp-signal-2 =
|
||||||
|
ramp-signal-3 =
|
||||||
|
ramp-signal-4 =
|
||||||
|
ramp-signal-foreground = ${colors.foreground-alt}
|
||||||
|
|
||||||
|
[module/date]
|
||||||
|
type = internal/date
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
date =
|
||||||
|
date-alt = " %D"
|
||||||
|
|
||||||
|
time = %I:%M:%S %p
|
||||||
|
time-alt = %I:%M:%S %p
|
||||||
|
|
||||||
|
format-prefix =
|
||||||
|
format-prefix-foreground = ${colors.foreground-alt}
|
||||||
|
format-underline =
|
||||||
|
|
||||||
|
label = %date% %time%
|
||||||
|
|
||||||
|
[module/pulseaudio]
|
||||||
|
type = internal/pulseaudio
|
||||||
|
|
||||||
|
format-volume = <label-volume> <bar-volume>
|
||||||
|
label-volume = VOL: %percentage%%
|
||||||
|
label-volume-foreground = ${root.foreground}
|
||||||
|
|
||||||
|
label-muted = 🔇 muted
|
||||||
|
label-muted-foreground =
|
||||||
|
|
||||||
|
bar-volume-width = 10
|
||||||
|
bar-volume-foreground-0 = #99cc00
|
||||||
|
bar-volume-foreground-1 = #99cc00
|
||||||
|
bar-volume-foreground-2 = #99cc00
|
||||||
|
bar-volume-foreground-3 = #99cc00
|
||||||
|
bar-volume-foreground-4 = #99cc00
|
||||||
|
bar-volume-foreground-5 = #f5a70a
|
||||||
|
bar-volume-foreground-6 = #ff5555
|
||||||
|
bar-volume-gradient = true
|
||||||
|
bar-volume-indicator = |
|
||||||
|
bar-volume-indicator-font = 2
|
||||||
|
bar-volume-fill = ─
|
||||||
|
bar-volume-fill-font = 2
|
||||||
|
bar-volume-empty = ─
|
||||||
|
bar-volume-empty-font = 2
|
||||||
|
bar-volume-empty-foreground = ${colors.foreground-alt}
|
||||||
|
|
||||||
|
[module/battery]
|
||||||
|
type = internal/battery
|
||||||
|
battery = BAT1
|
||||||
|
adapter = ADP1
|
||||||
|
full-at = 98
|
||||||
|
|
||||||
|
label-full = ""
|
||||||
|
|
||||||
|
format-charging = <animation-charging> <label-charging>
|
||||||
|
format-charging-underline = #ffb52a
|
||||||
|
|
||||||
|
format-discharging = <animation-discharging> <label-discharging>
|
||||||
|
format-discharging-underline =
|
||||||
|
|
||||||
|
format-full-prefix = " "
|
||||||
|
format-full-prefix-foreground = ${colors.foreground-alt}
|
||||||
|
format-full-underline =
|
||||||
|
|
||||||
|
ramp-capacity-0 =
|
||||||
|
ramp-capacity-1 =
|
||||||
|
ramp-capacity-2 =
|
||||||
|
ramp-capacity-foreground = ${colors.foreground-alt}
|
||||||
|
|
||||||
|
animation-charging-0 =
|
||||||
|
animation-charging-1 =
|
||||||
|
animation-charging-2 =
|
||||||
|
animation-charging-foreground = ${colors.foreground-alt}
|
||||||
|
animation-charging-framerate = 750
|
||||||
|
|
||||||
|
animation-discharging-0 =
|
||||||
|
animation-discharging-1 =
|
||||||
|
animation-discharging-2 =
|
||||||
|
animation-discharging-foreground = ${colors.foreground-alt}
|
||||||
|
animation-discharging-framerate = 750
|
||||||
|
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
screenchange-reload = true
|
||||||
|
;compositing-background = xor
|
||||||
|
compositing-background = screen
|
||||||
|
;compositing-foreground = source
|
||||||
|
;compositing-border = over
|
||||||
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
[global/wm]
|
||||||
|
margin-top = 0
|
||||||
|
margin-bottom = 0
|
||||||
|
|
||||||
|
; vim:ft=dosini
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
killall -q polybar
|
||||||
|
|
||||||
|
#while pgrep -u $UID -x polybar >/dev/null; do
|
||||||
|
# sleep 0.5; done
|
||||||
|
|
||||||
|
for m in $(polybar --list-monitors | cut -d":" -f1); do
|
||||||
|
MONITOR=$m polybar -c ~/.config/polybar/fluxbox-config.ini --reload &
|
||||||
|
done
|
||||||
+2
-1
@@ -4,4 +4,5 @@ configuration {
|
|||||||
show-icons: true;
|
show-icons: true;
|
||||||
icon-theme: "Papirus";
|
icon-theme: "Papirus";
|
||||||
}
|
}
|
||||||
@theme "~/.config/rofi/launchers/misc/kde_krunner.rasi"
|
|
||||||
|
@theme "~/.config/rofi/tokyonight.rasi"
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
* {
|
||||||
|
font: "Iosevka Nerd Font Medium 14";
|
||||||
|
|
||||||
|
bg0 : #1a1b26;
|
||||||
|
bg1 : #1f2335;
|
||||||
|
bg2 : #24283b;
|
||||||
|
bg3 : #414868;
|
||||||
|
fg0 : #c0caf5;
|
||||||
|
fg1 : #a9b1d6;
|
||||||
|
fg2 : #737aa2;
|
||||||
|
red : #f7768e;
|
||||||
|
green : #9ece6a;
|
||||||
|
yellow : #e0af68;
|
||||||
|
blue : #7aa2f7;
|
||||||
|
magenta : #9a7ecc;
|
||||||
|
cyan : #4abaaf;
|
||||||
|
|
||||||
|
accent: #d6181b;
|
||||||
|
urgent: @yellow;
|
||||||
|
|
||||||
|
background-color : transparent;
|
||||||
|
text-color : @fg0;
|
||||||
|
|
||||||
|
margin : 0;
|
||||||
|
padding : 0;
|
||||||
|
spacing : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon, element-text, scrollbar {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
window {
|
||||||
|
location : center;
|
||||||
|
width : 650px;
|
||||||
|
x-offset : 4px;
|
||||||
|
y-offset : 26px;
|
||||||
|
|
||||||
|
background-color: @bg1;
|
||||||
|
border: 1px;
|
||||||
|
border-color: @bg3;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
spacing : 8px;
|
||||||
|
padding : 4px 8px;
|
||||||
|
children : [ icon-search, entry ];
|
||||||
|
|
||||||
|
background-color: @bg0;
|
||||||
|
}
|
||||||
|
|
||||||
|
icon-search, entry, element-icon, element-text {
|
||||||
|
vertical-align: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
icon-search {
|
||||||
|
expand : false;
|
||||||
|
filename : "search-symbolic";
|
||||||
|
size : 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
textbox {
|
||||||
|
padding : 4px 8px;
|
||||||
|
background-color : @bg2;
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
padding : 4px 0px;
|
||||||
|
lines : 12;
|
||||||
|
columns : 1;
|
||||||
|
scrollbar : true;
|
||||||
|
fixed-height : false;
|
||||||
|
dynamic : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
element {
|
||||||
|
padding : 4px 8px;
|
||||||
|
spacing : 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element normal urgent {
|
||||||
|
text-color: @urgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
element normal active {
|
||||||
|
text-color: @accent;
|
||||||
|
}
|
||||||
|
|
||||||
|
element alternate active {
|
||||||
|
text-color: @accent;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected {
|
||||||
|
text-color : @bg1;
|
||||||
|
background-color : @accent;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected urgent {
|
||||||
|
background-color: @urgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollbar {
|
||||||
|
handle-width : 4px;
|
||||||
|
handle-color : @fg2;
|
||||||
|
padding : 0 4px;
|
||||||
|
}
|
||||||
Executable
+200
@@ -0,0 +1,200 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
## Grimshot: a helper for screenshots within sway
|
||||||
|
## Requirements:
|
||||||
|
## - `grim`: screenshot utility for wayland
|
||||||
|
## - `slurp`: to select an area
|
||||||
|
## - `swaymsg`: to read properties of current window
|
||||||
|
## - `wl-copy`: clipboard utility
|
||||||
|
## - `jq`: json utility to parse swaymsg output
|
||||||
|
## - `notify-send`: to show notifications
|
||||||
|
## Those are needed to be installed, if unsure, run `grimshot check`
|
||||||
|
##
|
||||||
|
## See `man 1 grimshot` or `grimshot usage` for further details.
|
||||||
|
|
||||||
|
getTargetDirectory() {
|
||||||
|
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" && \
|
||||||
|
. "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
||||||
|
|
||||||
|
echo "${XDG_SCREENSHOTS_DIR:-${XDG_PICTURES_DIR:-$HOME}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
NOTIFY=no
|
||||||
|
CURSOR=
|
||||||
|
WAIT=no
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
key="$1"
|
||||||
|
|
||||||
|
case $key in
|
||||||
|
-n|--notify)
|
||||||
|
NOTIFY=yes
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
-c|--cursor)
|
||||||
|
CURSOR=yes
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
-w|--wait)
|
||||||
|
shift
|
||||||
|
WAIT="$1"
|
||||||
|
if echo "$WAIT" | grep "[^0-9]" -q; then
|
||||||
|
echo "invalid value for wait '$WAIT'" >&2
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*) # unknown option
|
||||||
|
break # done with parsing --flags
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
ACTION=${1:-usage}
|
||||||
|
SUBJECT=${2:-screen}
|
||||||
|
FILE=${3:-$(getTargetDirectory)/$(date -Ins).png}
|
||||||
|
|
||||||
|
if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "savecopy" ] && [ "$ACTION" != "check" ]; then
|
||||||
|
echo "Usage:"
|
||||||
|
echo " grimshot [--notify] [--cursor] [--wait N] (copy|save) [active|screen|output|area|window|anything] [FILE|-]"
|
||||||
|
echo " grimshot check"
|
||||||
|
echo " grimshot usage"
|
||||||
|
echo ""
|
||||||
|
echo "Commands:"
|
||||||
|
echo " copy: Copy the screenshot data into the clipboard."
|
||||||
|
echo " save: Save the screenshot to a regular file or '-' to pipe to STDOUT."
|
||||||
|
echo " savecopy: Save the screenshot to a regular file and copy the data into the clipboard."
|
||||||
|
echo " check: Verify if required tools are installed and exit."
|
||||||
|
echo " usage: Show this message and exit."
|
||||||
|
echo ""
|
||||||
|
echo "Targets:"
|
||||||
|
echo " active: Currently active window."
|
||||||
|
echo " screen: All visible outputs."
|
||||||
|
echo " output: Currently active output."
|
||||||
|
echo " area: Manually select a region."
|
||||||
|
echo " window: Manually select a window."
|
||||||
|
echo " anything: Manually select an area, window, or output."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
notify-send -t 3000 -a grimshot "$@"
|
||||||
|
}
|
||||||
|
notifyOk() {
|
||||||
|
[ "$NOTIFY" = "no" ] && return
|
||||||
|
|
||||||
|
TITLE=${2:-"Screenshot"}
|
||||||
|
MESSAGE=${1:-"OK"}
|
||||||
|
|
||||||
|
if [ "$ACTION" = "save" ] || [ "$ACTION" = "savecopy" ]; then
|
||||||
|
notify "$TITLE" "$MESSAGE" -i "$FILE"
|
||||||
|
else
|
||||||
|
notify "$TITLE" "$MESSAGE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
notifyError() {
|
||||||
|
if [ $NOTIFY = "yes" ]; then
|
||||||
|
TITLE=${2:-"Screenshot"}
|
||||||
|
MESSAGE=${1:-"Error taking screenshot with grim"}
|
||||||
|
notify -u critical "$TITLE" "$MESSAGE"
|
||||||
|
else
|
||||||
|
echo "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
die() {
|
||||||
|
MSG=${1:-Bye}
|
||||||
|
notifyError "Error: $MSG"
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
COMMAND=$1
|
||||||
|
if command -v "$COMMAND" > /dev/null 2>&1; then
|
||||||
|
RESULT="OK"
|
||||||
|
else
|
||||||
|
RESULT="NOT FOUND"
|
||||||
|
fi
|
||||||
|
echo " $COMMAND: $RESULT"
|
||||||
|
}
|
||||||
|
|
||||||
|
takeScreenshot() {
|
||||||
|
FILE=$1
|
||||||
|
GEOM=$2
|
||||||
|
OUTPUT=$3
|
||||||
|
if [ -n "$OUTPUT" ]; then
|
||||||
|
grim ${CURSOR:+-c} -o "$OUTPUT" "$FILE" || die "Unable to invoke grim"
|
||||||
|
elif [ -z "$GEOM" ]; then
|
||||||
|
grim ${CURSOR:+-c} "$FILE" || die "Unable to invoke grim"
|
||||||
|
else
|
||||||
|
grim ${CURSOR:+-c} -g "$GEOM" "$FILE" || die "Unable to invoke grim"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$ACTION" = "check" ] ; then
|
||||||
|
echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..."
|
||||||
|
check grim
|
||||||
|
check slurp
|
||||||
|
check swaymsg
|
||||||
|
check wl-copy
|
||||||
|
check jq
|
||||||
|
check notify-send
|
||||||
|
exit
|
||||||
|
elif [ "$SUBJECT" = "area" ] ; then
|
||||||
|
GEOM=$(slurp -d)
|
||||||
|
# Check if user exited slurp without selecting the area
|
||||||
|
if [ -z "$GEOM" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
WHAT="Area"
|
||||||
|
elif [ "$SUBJECT" = "active" ] ; then
|
||||||
|
FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)')
|
||||||
|
GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"')
|
||||||
|
APP_ID=$(echo "$FOCUSED" | jq -r '.app_id')
|
||||||
|
WHAT="$APP_ID window"
|
||||||
|
elif [ "$SUBJECT" = "screen" ] ; then
|
||||||
|
GEOM=""
|
||||||
|
WHAT="Screen"
|
||||||
|
elif [ "$SUBJECT" = "output" ] ; then
|
||||||
|
GEOM=""
|
||||||
|
OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name')
|
||||||
|
WHAT="$OUTPUT"
|
||||||
|
elif [ "$SUBJECT" = "window" ] ; then
|
||||||
|
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -r)
|
||||||
|
# Check if user exited slurp without selecting the area
|
||||||
|
if [ -z "$GEOM" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
WHAT="Window"
|
||||||
|
elif [ "$SUBJECT" = "anything" ] ; then
|
||||||
|
GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -o)
|
||||||
|
# Check if user exited slurp without selecting the area
|
||||||
|
if [ -z "$GEOM" ]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
WHAT="Selection"
|
||||||
|
else
|
||||||
|
die "Unknown subject to take a screen shot from" "$SUBJECT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$WAIT" != "no" ]; then
|
||||||
|
sleep "$WAIT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$ACTION" = "copy" ] ; then
|
||||||
|
takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error"
|
||||||
|
notifyOk "$WHAT copied to clipboard"
|
||||||
|
else
|
||||||
|
if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then
|
||||||
|
TITLE="Screenshot of $SUBJECT"
|
||||||
|
MESSAGE=$(basename "$FILE")
|
||||||
|
if [ "$ACTION" = "savecopy" ]; then
|
||||||
|
wl-copy --type image/png < "$FILE" || die "Clipboard error"
|
||||||
|
MESSAGE="$MESSAGE and clipboard"
|
||||||
|
fi
|
||||||
|
notifyOk "$MESSAGE" "$TITLE"
|
||||||
|
echo "$FILE"
|
||||||
|
else
|
||||||
|
notifyError "Error taking screenshot with grim"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
export QT_STYLE_OVERRIDE=kvantum
|
export QT_STYLE_OVERRIDE=kvantum
|
||||||
systemctl --user import-enviornment DISPLAY
|
export XDG_SESSION_TYPE=X11
|
||||||
|
systemctl --user import-environment DISPLAY
|
||||||
|
|
||||||
|
# xset -dpms
|
||||||
|
# xset s noblank
|
||||||
|
xset s off -dpms
|
||||||
|
|
||||||
udiskie --tray &
|
udiskie --tray &
|
||||||
autorandr --change &
|
autorandr --change
|
||||||
xset -dpms
|
|
||||||
xset s noblank
|
|
||||||
xset s off -dpms
|
|
||||||
wal -i ~/.wallpapers
|
|
||||||
exec i3
|
exec i3
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ CASE_SENSITIVE="true"
|
|||||||
zstyle ':omz:update' mode auto # update automatically without asking
|
zstyle ':omz:update' mode auto # update automatically without asking
|
||||||
zstyle ':omz:update' frequency 7
|
zstyle ':omz:update' frequency 7
|
||||||
|
|
||||||
plugins=(zsh-autosuggestions sudo web-search copyfile dirhistory jsontools)
|
plugins=(zsh-autosuggestions sudo web-search poetry copypath gitignore)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
@@ -18,6 +18,7 @@ export LANG=en_US.UTF-8
|
|||||||
export EDITOR='nvim'
|
export EDITOR='nvim'
|
||||||
export VISUAL='nvim'
|
export VISUAL='nvim'
|
||||||
alias vim='nvim'
|
alias vim='nvim'
|
||||||
|
alias ws='web_search'
|
||||||
|
|
||||||
zstyle ':completion:*' completer _complete _approximate
|
zstyle ':completion:*' completer _complete _approximate
|
||||||
zstyle ':completion:*' group-name ''
|
zstyle ':completion:*' group-name ''
|
||||||
@@ -49,3 +50,10 @@ export PATH
|
|||||||
|
|
||||||
# put your paths and aliases here to avoid merge conflicts
|
# put your paths and aliases here to avoid merge conflicts
|
||||||
[[ ! -f ~/.myzsh ]] || source ~/.myzsh
|
[[ ! -f ~/.myzsh ]] || source ~/.myzsh
|
||||||
|
[[ -f ~/.profile ]] && . ~/.profile
|
||||||
|
|
||||||
|
## [Completion]
|
||||||
|
## Completion scripts setup. Remove the following line to uninstall
|
||||||
|
[[ -f /home/frosty/.dart-cli-completion/zsh-config.zsh ]] && . /home/frosty/.dart-cli-completion/zsh-config.zsh || true
|
||||||
|
## [/Completion]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user