laptop
Elias Almqvist 10 months ago
commit 95765ab8b7
No known key found for this signature in database
GPG Key ID: E31A99CE3E75A158
  1. 24
      doomemacs/.doom.d/config.el
  2. 3
      doomemacs/.doom.d/packages.el
  3. 22
      nvchad/.config/nvim/lua/custom/chadrc.lua
  4. 33
      nvchad/.config/nvim/lua/custom/configs/conform.lua
  5. 18
      nvchad/.config/nvim/lua/custom/configs/lspconfig.lua
  6. 59
      nvchad/.config/nvim/lua/custom/configs/overrides.lua
  7. 19
      nvchad/.config/nvim/lua/custom/highlights.lua
  8. 7
      nvchad/.config/nvim/lua/custom/init.lua
  9. 38
      nvchad/.config/nvim/lua/custom/mappings.lua
  10. 78
      nvchad/.config/nvim/lua/custom/plugins.lua
  11. 8
      nvim/.config/nvim/lua/evim/packer.lua
  12. 1
      nvim/.config/nvim/plugin/after/lualine.lua
  13. 30
      nvim/.config/nvim/plugin/packer_compiled.lua

@ -6,7 +6,7 @@
;; Some functionality uses this to identify you, e.g. GPG configuration, email ;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional. ;; clients, file templates and snippets. It is optional.
(setq user-full-name "E. Almqvist" (setq user-full-name "Elias Almqvist"
user-mail-address "elalmqvist@gmail.com") user-mail-address "elalmqvist@gmail.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom: ;; Doom exposes five (optional) variables for controlling fonts in Doom:
@ -104,3 +104,25 @@
(global-set-key (kbd "M-g") 'format-all-buffer) (global-set-key (kbd "M-g") 'format-all-buffer)
;; accept completion from copilot and fallback to company
(use-package! copilot
:hook (prog-mode . copilot-mode)
:bind (:map copilot-completion-map
("<tab>" . 'copilot-accept-completion)
("TAB" . 'copilot-accept-completion)
("C-TAB" . 'copilot-accept-completion-by-word)
("C-<tab>" . 'copilot-accept-completion-by-word)))
(after! (evil copilot)
;; Define the custom function that either accepts the completion or does the default behavior
(defun my/copilot-tab-or-default ()
(interactive)
(if (and (bound-and-true-p copilot-mode)
;; Add any other conditions to check for active copilot suggestions if necessary
)
(copilot-accept-completion)
(evil-insert 1))) ; Default action to insert a tab. Adjust as needed.
;; Bind the custom function to <tab> in Evil's insert state
(evil-define-key 'insert 'global (kbd "<tab>") 'my/copilot-tab-or-default))

@ -48,3 +48,6 @@
;(unpin! pinned-package another-pinned-package) ;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t) ;(unpin! t)
(package! copilot
:recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))

@ -0,0 +1,22 @@
---@type ChadrcConfig
local M = {}
-- Path to overriding theme and highlights files
local highlights = require "custom.highlights"
M.ui = {
theme = "onedark",
theme_toggle = { "onedark", "one_light" },
hl_override = highlights.override,
hl_add = highlights.add,
}
M.plugins = "custom.plugins"
-- check core.mappings for table structure
M.mappings = require "custom.mappings"
return M

@ -0,0 +1,33 @@
local options = {
lsp_fallback = true,
formatters_by_ft = {
-- Divine Intellect Languages
lua = { "stylua" },
-- Web Dev shit
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
scss = { "prettier" },
html = { "prettier" },
-- Data Science & AI stuff
python = { "black" },
sh = { "shfmt" },
},
-- adding same formatter for multiple filetypes can look too much work for some
-- instead of the above code you could just use a loop! the config is just a table after all!
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
require("conform").setup(options)

@ -0,0 +1,18 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd", "ghdl_ls" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
--
-- lspconfig.pyright.setup { blabla}
--

@ -0,0 +1,59 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
}
M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

@ -0,0 +1,19 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors
local M = {}
---@type Base46HLGroupsList
M.override = {
Comment = {
italic = true,
},
}
---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}
return M

@ -0,0 +1,7 @@
-- local autocmd = vim.api.nvim_create_autocmd
-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })

@ -0,0 +1,38 @@
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
-- format with conform
["<leader>fm"] = {
function()
require("conform").format()
end,
"formatting",
},
},
v = {
-- Indentation
[">"] = { ">gv", "indent" },
-- Move selection up/down with K/J
["J"] = { ":m '>+1<CR>gv=gv", "move selection down" },
["K"] = { ":m '<-2<CR>gv=gv", "move selection up" },
},
i = {
["<C-l>"] = {
function()
vim.fn.feedkeys(vim.fn["copilot#Accept"](), "")
end,
"Copilot Accept",
{ replace_keycodes = true, nowait = true, silent = true, expr = true, noremap = true },
},
},
}
-- more keybinds!
return M

@ -0,0 +1,78 @@
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
{
"stevearc/conform.nvim",
-- for users those who want auto-save conform + lazyloading!
-- event = "BufWritePre"
config = function()
require "custom.configs.conform"
end,
},
{
"github/copilot.vim",
lazy = false,
config = function()
-- Mapping tab is already used by NvChad
vim.g.copilot_no_tab_map = true;
vim.g.copilot_assume_mapped = true;
vim.g.copilot_tab_fallback = "";
-- The mapping is set to other key, see custom/lua/mappings
-- or run <leader>ch to see copilot mapping section
end
},
-- To make a plugin not be loaded
-- {
-- "NvChad/nvim-colorizer.lua",
-- enabled = false
-- },
-- All NvChad plugins are lazy-loaded by default
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
-- {
-- "mg979/vim-visual-multi",
-- lazy = false,
-- }
}
return plugins

@ -61,10 +61,10 @@ return require("packer").startup(function(use)
-- Misc -- Misc
-- use "vimsence/vimsence" -- use "vimsence/vimsence"
use "andweeb/presence.nvim" use "andweeb/presence.nvim"
use { -- use {
"nvim-lualine/lualine.nvim", -- "nvim-lualine/lualine.nvim",
requires = { "nvim-tree/nvim-web-devicons", opt = true } -- requires = { "nvim-tree/nvim-web-devicons", opt = true }
} -- }
use { use {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",

@ -1 +0,0 @@
require("lualine").setup()

@ -49,8 +49,8 @@ local function save_profiles(threshold)
end end
time([[Luarocks path setup]], true) time([[Luarocks path setup]], true)
local package_path_str = "/home/elal/.cache/nvim/packer_hererocks/2.1.1697887905/share/lua/5.1/?.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1697887905/share/lua/5.1/?/init.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1697887905/lib/luarocks/rocks-5.1/?.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1697887905/lib/luarocks/rocks-5.1/?/init.lua" local package_path_str = "/home/elal/.cache/nvim/packer_hererocks/2.1.1702233742/share/lua/5.1/?.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1702233742/share/lua/5.1/?/init.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1702233742/lib/luarocks/rocks-5.1/?.lua;/home/elal/.cache/nvim/packer_hererocks/2.1.1702233742/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/elal/.cache/nvim/packer_hererocks/2.1.1697887905/lib/lua/5.1/?.so" local install_cpath_pattern = "/home/elal/.cache/nvim/packer_hererocks/2.1.1702233742/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str package.path = package.path .. ';' .. package_path_str
end end
@ -106,11 +106,6 @@ _G.packer_plugins = {
path = "/home/elal/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", path = "/home/elal/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
url = "https://github.com/VonHeikemen/lsp-zero.nvim" url = "https://github.com/VonHeikemen/lsp-zero.nvim"
}, },
["lualine.nvim"] = {
loaded = true,
path = "/home/elal/.local/share/nvim/site/pack/packer/start/lualine.nvim",
url = "https://github.com/nvim-lualine/lualine.nvim"
},
["mason-lspconfig.nvim"] = { ["mason-lspconfig.nvim"] = {
loaded = true, loaded = true,
path = "/home/elal/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", path = "/home/elal/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
@ -153,6 +148,11 @@ _G.packer_plugins = {
path = "/home/elal/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", path = "/home/elal/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons",
url = "https://github.com/nvim-tree/nvim-web-devicons" url = "https://github.com/nvim-tree/nvim-web-devicons"
}, },
["nvim-treesitter"] = {
loaded = true,
path = "/home/elal/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["onedark.nvim"] = { ["onedark.nvim"] = {
loaded = true, loaded = true,
path = "/home/elal/.local/share/nvim/site/pack/packer/start/onedark.nvim", path = "/home/elal/.local/share/nvim/site/pack/packer/start/onedark.nvim",
@ -197,6 +197,14 @@ _G.packer_plugins = {
} }
time([[Defining packer_plugins]], false) time([[Defining packer_plugins]], false)
-- Config for: gitsigns.nvim
time([[Config for gitsigns.nvim]], true)
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rgitsigns\frequire\0", "config", "gitsigns.nvim")
time([[Config for gitsigns.nvim]], false)
-- Config for: todo-comments.nvim
time([[Config for todo-comments.nvim]], true)
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim")
time([[Config for todo-comments.nvim]], false)
-- Config for: Comment.nvim -- Config for: Comment.nvim
time([[Config for Comment.nvim]], true) time([[Config for Comment.nvim]], true)
try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim") try_loadstring("\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0", "config", "Comment.nvim")
@ -205,14 +213,6 @@ time([[Config for Comment.nvim]], false)
time([[Config for nvim-autopairs]], true) time([[Config for nvim-autopairs]], true)
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs")
time([[Config for nvim-autopairs]], false) time([[Config for nvim-autopairs]], false)
-- Config for: todo-comments.nvim
time([[Config for todo-comments.nvim]], true)
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim")
time([[Config for todo-comments.nvim]], false)
-- Config for: gitsigns.nvim
time([[Config for gitsigns.nvim]], true)
try_loadstring("\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rgitsigns\frequire\0", "config", "gitsigns.nvim")
time([[Config for gitsigns.nvim]], false)
_G._packer.inside_compile = false _G._packer.inside_compile = false
if _G._packer.needs_bufread == true then if _G._packer.needs_bufread == true then

Loading…
Cancel
Save