aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorLuca Matei Pintilie <lucafulger@gmail.com>2023-04-01 19:46:14 +0000
committerLuca Matei Pintilie <lucafulger@gmail.com>2023-04-01 19:46:14 +0000
commit13a10383f190fdc2f4cc95c0b104627fe375c66f (patch)
tree6d3714eae69088d7e26789960eb8864a1c35e23d /.config
parente4588098e2c76fac277f3598c8d0e2c60722f1ab (diff)
downloaddotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar.gz
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar.bz2
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar.lz
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar.xz
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.tar.zst
dotfiles-13a10383f190fdc2f4cc95c0b104627fe375c66f.zip
Improve IDE related configs
Diffstat (limited to '.config')
-rw-r--r--.config/emacs/early-init.el1
-rw-r--r--.config/emacs/init.el79
-rw-r--r--.config/nvim/lua/keybinds.lua8
-rw-r--r--.config/nvim/lua/plugins.lua34
4 files changed, 106 insertions, 16 deletions
diff --git a/.config/emacs/early-init.el b/.config/emacs/early-init.el
new file mode 100644
index 0000000..512068a
--- /dev/null
+++ b/.config/emacs/early-init.el
@@ -0,0 +1 @@
+(setq package-enable-at-startup nil)
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 74b7592..23883f6 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -1,19 +1,70 @@
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right.
- '(package-selected-packages '(evil)))
-(custom-set-faces
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- )
+(defvar elpaca-installer-version 0.3)
+(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
+(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
+(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
+(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
+ :ref nil
+ :files (:defaults (:exclude "extensions"))
+ :build (:not elpaca--activate-package)))
+(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
+ (build (expand-file-name "elpaca/" elpaca-builds-directory))
+ (order (cdr elpaca-order))
+ (default-directory repo))
+ (add-to-list 'load-path (if (file-exists-p build) build repo))
+ (unless (file-exists-p repo)
+ (make-directory repo t)
+ (condition-case-unless-debug err
+ (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
+ ((zerop (call-process "git" nil buffer t "clone"
+ (plist-get order :repo) repo)))
+ ((zerop (call-process "git" nil buffer t "checkout"
+ (or (plist-get order :ref) "--"))))
+ (emacs (concat invocation-directory invocation-name))
+ ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
+ "--eval" "(byte-recompile-directory \".\" 0 'force)")))
+ ((require 'elpaca))
+ ((elpaca-generate-autoloads "elpaca" repo)))
+ (kill-buffer buffer)
+ (error "%s" (with-current-buffer buffer (buffer-string))))
+ ((error) (warn "%s" err) (delete-directory repo 'recursive))))
+ (unless (require 'elpaca-autoloads nil t)
+ (require 'elpaca)
+ (elpaca-generate-autoloads "elpaca" repo)
+ (load "./elpaca-autoloads")))
+(add-hook 'after-init-hook #'elpaca-process-queues)
+(elpaca `(,@elpaca-order))
+
+;; Install use-package support
+(elpaca elpaca-use-package
+ ;; Enable :elpaca use-package keyword.
+ (elpaca-use-package-mode)
+ ;; Assume :elpaca t unless otherwise specified.
+ (setq elpaca-use-package-by-default t))
+
+;; Block until current queue processed.
+(elpaca-wait)
+
+
+(use-package evil :demand t)
+(use-package eglot
+ :commands (eglot eglot-ensure)
+ :hook ((python-mode . eglot-ensure)
+ (csharp-mode . eglot-ensure))
+ :config
+ (progn
+ (define-key eglot-mode-map (kbd "C-c e r") 'eglot-rename)
+ (define-key eglot-mode-map (kbd "C-c e f") 'eglot-format)
+ (define-key eglot-mode-map (kbd "C-c e h") 'eglot-help-at-point)
+ (add-to-list 'eglot-server-programs
+ `(csharp-mode . ("omnisharp" "-lsp")))))
+
+(use-package company :demand t)
+
(when (version<= "26.0.50" emacs-version )
(global-display-line-numbers-mode))
(setq backup-directory-alist '(("" . "~/.local/emacs/backup")))
-(if (and (fboundp 'evil-mode)
- (not (evil-mode)))
- (evil-mode))
+
+; (add-hook 'after-init-hook 'global-company-mode)
+
diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua
index 372335a..b017716 100644
--- a/.config/nvim/lua/keybinds.lua
+++ b/.config/nvim/lua/keybinds.lua
@@ -2,6 +2,7 @@ local telescope = require("telescope.builtin")
local wk = require("which-key")
local ufo = require("ufo")
local nt_api = require("nvim-tree.api")
+local spider = require("spider")
vim.g.mapleader = " "
@@ -23,6 +24,7 @@ vim.keymap.set("n", "<Leader>f", telescope.find_files)
vim.keymap.set("n", "<Leader><TAB>", telescope.buffers)
vim.keymap.set("n", "<Leader>D", telescope.lsp_definitions)
vim.keymap.set("n", "<Leader>R", telescope.lsp_references)
+vim.keymap.set("n", "<Leader>S", telescope.lsp_document_symbols)
vim.keymap.set("n", "<Leader>m", ":MinimapToggle<CR>")
vim.keymap.set("n", "<Leader>b", ":Gitsigns blame_line<CR>")
@@ -36,12 +38,18 @@ vim.keymap.set("n", "<Leader>[", ufo.openAllFolds)
vim.keymap.set("n", "<Leader>]", ufo.closeAllFolds)
vim.keymap.set("n", "<Leader>r", vim.lsp.buf.rename)
+vim.keymap.set({ "n"; "o"; "x" }, "W", function() spider.motion("w") end)
+vim.keymap.set({ "n"; "o"; "x" }, "E", function() spider.motion("e") end)
+vim.keymap.set({ "n"; "o"; "x" }, "B", function() spider.motion("b") end)
+vim.keymap.set({ "n"; "o"; "x" }, "gE", function() spider.motion("ge") end)
+
vim.opt.whichwrap = "<,>,h,l,[,]"
wk.register({
["<CR>"] = "Quick Action";
["K"] = "Hover";
["D"] = "Definition";
+ ["S"] = "Symbols";
["F"] = "Format";
["f"] = "Find files";
["<TAB>"] = "Show buffers";
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index d261628..f4b9ba5 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -6,6 +6,9 @@ local PKGS = {
{ url = "https://github.com/kyazdani42/nvim-web-devicons.git" };
{ url = "https://github.com/ojroques/nvim-osc52.git" };
{ url = "https://github.com/chentoast/marks.nvim.git" };
+ { url = "https://github.com/chrisgrieser/nvim-spider.git" };
+ { url = "https://github.com/nvim-orgmode/orgmode.git" };
+ { url = "https://github.com/rainbowhxch/beacon.nvim.git" };
{ url = "https://github.com/kyazdani42/nvim-tree.lua.git" };
{ url = "https://github.com/nvim-telescope/telescope.nvim.git" };
@@ -140,6 +143,19 @@ local function init_plugins()
-- Available modes: foreground, background
mode = "foreground"; -- Set the display mode.
})
+ require("beacon").setup({
+ enable = true;
+ size = 100;
+ fade = true;
+ minimal_jump = 10;
+ show_jumps = true;
+ focus_gained = false;
+ shrink = false;
+ timeout = 1000;
+ ignore_buffers = {};
+ ignore_filetypes = {};
+ })
+
vim.g.minimap_auto_start = 0
vim.g.minimap_highlight_range = 1
vim.g.minimap_highlight_search = 1
@@ -170,12 +186,26 @@ local function init_plugins()
require("devcontainer").setup({})
require("which-key").setup({})
+ local orgmode = require("orgmode")
+ orgmode.setup_ts_grammar()
require("nvim-treesitter.configs").setup({
- ensure_installed = { "javascript"; "typescript"; "lua"; "c_sharp"; "jsonc" };
+ ensure_installed = {
+ "javascript";
+ "typescript";
+ "lua";
+ "c_sharp";
+ "jsonc";
+ "org";
+ };
sync_install = false;
auto_install = true;
- highlight = { enable = true; disable = { "markdown"; "yaml"; "sql"; "help" } };
+ highlight = {
+ enable = true;
+ disable = { "markdown"; "yaml"; "sql"; "help" };
+ additional_vim_regex_highlighting = { "org" };
+ };
})
+ orgmode.setup({ org_default_notes_file = "~/.cache/org/refile.org" })
require("mini.surround").setup({})