Browse Source

feat: convert vimscript autocmd to lua

master
Tovi Jaeschke-Rogers 2 months ago
parent
commit
d3c5d1edca
2 changed files with 12 additions and 1 deletions
  1. +7
    -0
      .config/nvim/.stylelua.toml
  2. +5
    -1
      .config/nvim/lua/core/autocmd.lua

+ 7
- 0
.config/nvim/.stylelua.toml View File

@ -0,0 +1,7 @@
column_width = 160
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "ForceDouble"
no_call_parentheses = false
collapse_simple_statement = 'Always'

+ 5
- 1
.config/nvim/lua/core/autocmd.lua View File

@ -27,7 +27,11 @@ local aucmd_dict = {
BufRead = { BufRead = {
{ {
-- Return cursor to where it was previously when re-opening a file -- Return cursor to where it was previously when re-opening a file
command = [[if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif]]
callback = function()
if vim.fn.expand('%:p') ~= '.git/COMMIT_EDITMSG' and vim.fn.line("'\"") > 1 and vim.fn.line("'\"") <= vim.fn.line("$") then
vim.cmd("normal! g`\"")
end
end
}, },
{ {


Loading…
Cancel
Save