-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Replace .vim files with .lua
Closes #525
- Loading branch information
1 parent
be6811b
commit 651078a
Showing
4 changed files
with
45 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
if vim.b.did_ftplugin then | ||
return | ||
end | ||
---@diagnostic disable-next-line: inject-field | ||
vim.b.did_ftplugin = true | ||
|
||
local config = require('orgmode.config') | ||
|
||
config:setup_mappings('org') | ||
config:setup_mappings('text_objects') | ||
config:setup_foldlevel() | ||
|
||
vim.bo.modeline = false | ||
vim.opt_local.fillchars:append('fold: ') | ||
vim.opt_local.foldmethod = 'expr' | ||
vim.opt_local.foldexpr = 'nvim_treesitter#foldexpr()' | ||
vim.opt_local.foldtext = 'v:lua.require("orgmode.org.indent").foldtext()' | ||
vim.opt_local.formatexpr = 'v:lua.require("orgmode.org.format")()' | ||
vim.opt_local.omnifunc = 'v:lua.orgmode.omnifunc' | ||
vim.opt_local.commentstring = '# %s' | ||
|
||
_G.orgmode.omnifunc = function(findstart, base) | ||
return require('orgmode.org.autocompletion.omni').omnifunc(findstart, base) | ||
end | ||
|
||
local abbreviations = { | ||
[':today:'] = "require('orgmode.objects.date').today():to_wrapped_string(true)", | ||
[':now:'] = "require('orgmode.objects.date').now():to_wrapped_string(true)", | ||
[':itoday:'] = "require('orgmode.objects.date').today():to_wrapped_string(false)", | ||
[':inow:'] = "require('orgmode.objects.date').now():to_wrapped_string(false)", | ||
} | ||
|
||
for abbrev, cmd in pairs(abbreviations) do | ||
vim.cmd.inoreabbrev(('<silent><buffer> %s <C-R>=luaeval("%s")<CR>'):format(abbrev, cmd)) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if vim.b.did_indent then | ||
return | ||
end | ||
---@diagnostic disable-next-line: inject-field | ||
vim.b.did_indent = true | ||
|
||
vim.bo.indentexpr = 'v:lua.require("orgmode.org.indent").indentexpr()' | ||
vim.bo.lisp = false | ||
vim.bo.smartindent = false | ||
vim.bo.autoindent = true |
This file was deleted.
Oops, something went wrong.