aboutsummaryrefslogtreecommitdiffstats
path: root/lua/config/editor.lua
diff options
context:
space:
mode:
authorphilw <dscr@duck.com>2025-01-13 15:52:11 +0100
committerphilw <dscr@duck.com>2025-01-13 15:52:11 +0100
commitc233e93c2552940d228be7adb077da47ef42761f (patch)
tree241b20fa2f0cf2818bd6bdb06b4b99bfa7e90bcc /lua/config/editor.lua
parent783a40f4f430b2daec157e5396e5bd4d3ea65657 (diff)
downloadneovim-c233e93c2552940d228be7adb077da47ef42761f.tar.gz
neovim-c233e93c2552940d228be7adb077da47ef42761f.zip
Update config
Diffstat (limited to '')
-rw-r--r--lua/config/editor.lua86
1 files changed, 0 insertions, 86 deletions
diff --git a/lua/config/editor.lua b/lua/config/editor.lua
index 0649006..e69de29 100644
--- a/lua/config/editor.lua
+++ b/lua/config/editor.lua
@@ -1,86 +0,0 @@
1local option = vim.opt
2local keymap = vim.keymap
3
4--Basic Editor Setup
5option.nu = true
6option.tabstop = 2
7option.softtabstop = 2
8option.shiftwidth = 2
9option.expandtab = true
10option.smartindent = true
11option.wrap = false
12option.swapfile = false
13option.hlsearch = false
14option.incsearch = true
15option.updatetime = 50
16option.laststatus = 0
17option.signcolumn = "number"
18option.autoindent = true
19option.clipboard = "unnamedplus"
20option.termguicolors = false
21option.fillchars = 'eob: '
22
23-- Setup Editor Theme
24vim.cmd([[
25highlight GitGutterAdd ctermbg=none
26highlight GitGutterAdd guibg=none
27highlight NonText guifg=none
28highlight EndOfBuffer ctermfg=none ctermbg=none
29highlight Normal ctermbg=none
30highlight Normal guibg=none
31highlight signcolumn ctermbg=none
32highlight signcolumn guibg=none
33highlight StatusLine ctermbg=none
34highlight StatusLine guibg=none
35highlight DiagnosticError ctermbg=none
36highlight DiagnosticError guibg=none
37highlight DiagnosticWarn ctermbg=none
38highlight DiagnosticWarn guibg=none
39highlight DiagnosticInfo ctermbg=none
40highlight DiagnosticInfo guibg=none
41highlight DiagnosticHint ctermbg=none
42highlight DiagnosticHint guibg=none
43
44highlight DiagnosticVirtualError ctermbg=none
45highlight DiagnosticVirtualError guibg=none
46highlight DiagnosticVirtualWarn ctermbg=none
47highlight DiagnosticVirtualWarn guibg=none
48highlight DiagnosticVirtualInfo ctermbg=none
49highlight DiagnosticVirtualInfo guibg=none
50highlight DiagnosticVirtualHint ctermbg=none
51highlight DiagnosticVirtualHint guibg=none
52
53highlight DiagnosticVirtualTextError ctermbg=none
54highlight DiagnosticVirtualTextError guibg=none
55highlight DiagnosticVirtualTextWarn ctermbg=none
56highlight DiagnosticVirtualTextWarn guibg=none
57highlight DiagnosticVirtualTextInfo ctermbg=none
58highlight DiagnosticVirtualTextInfo guibg=none
59highlight DiagnosticVirtualTextHint ctermbg=none
60highlight DiagnosticVirtualTextHint guibg=none
61]])
62
63-- run specific commands after different file extensions
64vim.cmd([[
65augroup RunPfOnSave
66autocmd!
67autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write %
68autocmd BufWritePost *.tex silent! :VimtexCompile
69autocmd BufWritePost *.md silent! :MarkdownPreview
70autocmd BufWritePost *.php silent! !php-cs-fixer fix %
71augroup END
72]])
73
74-- Gui options
75vim.o.guifont = "Fira Code:h7"
76vim.g.vimtex_view_method = "zathura"
77vim.g.vimtex_compiler_method = "latexrun"
78vim.g.gitgutter_set_sign_backgrounds = 1
79
80--Keybinds
81vim.g.mapleader = " "
82keymap.set("n", "<leader>e", vim.cmd.Ex)
83keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
84keymap.set("n", "<leader>a", "ggVG")
85keymap.set("v", "J", ":m '>+1<CR>gv=gv")
86keymap.set("v", "K", ":m '<-2<CR>gv=gv")