-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
406e3e7
commit 9b36254
Showing
11 changed files
with
166 additions
and
61 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 @@ | ||
vim.opt_local.spell = false |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require("neotex.core.keymaps") | ||
require("neotex.core.options") | ||
require("neotex.core.autocmds") | ||
require("neotex.core.functions") | ||
require("neotex.core.keymaps") | ||
require("neotex.core.options") |
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
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
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,57 @@ | ||
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>") | ||
|
||
local state = { | ||
floating = { | ||
buf = -1, | ||
win = -1, | ||
} | ||
} | ||
|
||
local function create_floating_window(opts) | ||
opts = opts or {} | ||
local width = opts.width or math.floor(vim.o.columns * 0.8) | ||
local height = opts.height or math.floor(vim.o.lines * 0.8) | ||
|
||
-- Calculate the position to center the window | ||
local col = math.floor((vim.o.columns - width) / 2) | ||
local row = math.floor((vim.o.lines - height) / 2) | ||
|
||
-- Create a buffer | ||
local buf = nil | ||
if vim.api.nvim_buf_is_valid(opts.buf) then | ||
buf = opts.buf | ||
else | ||
buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer | ||
end | ||
|
||
-- Define window configuration | ||
local win_config = { | ||
relative = "editor", | ||
width = width, | ||
height = height, | ||
col = col, | ||
row = row, | ||
style = "minimal", -- No borders or extra UI elements | ||
border = "rounded", | ||
} | ||
|
||
-- Create the floating window | ||
local win = vim.api.nvim_open_win(buf, true, win_config) | ||
|
||
return { buf = buf, win = win } | ||
end | ||
|
||
local toggle_terminal = function() | ||
if not vim.api.nvim_win_is_valid(state.floating.win) then | ||
state.floating = create_floating_window { buf = state.floating.buf } | ||
if vim.bo[state.floating.buf].buftype ~= "terminal" then | ||
vim.cmd.terminal() | ||
end | ||
else | ||
vim.api.nvim_win_hide(state.floating.win) | ||
end | ||
end | ||
|
||
-- Example usage: | ||
-- Create a floating window with default dimensions | ||
vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {}) |
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
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
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
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
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 |
---|---|---|
|
@@ -83,6 +83,7 @@ return { | |
c = { "<cmd>vert sb<CR>", "create split" }, | ||
-- k = { "<cmd>clo<CR>", "kill split" }, | ||
d = { "<cmd>update! | bdelete!<CR>", "delete buffer" }, | ||
-- d = { ":lua CloseBuffer()<CR>", "delete buffer" }, | ||
e = { "<cmd>NvimTreeToggle<CR>", "explorer" }, | ||
j = { "<cmd>clo<CR>", "drop split" }, | ||
-- h = { "<cmd>Alpha<CR>", "home" }, | ||
|
@@ -98,25 +99,27 @@ return { | |
a = { "<cmd>lua PdfAnnots()<CR>", "annotate" }, | ||
b = { "<cmd>terminal bibexport -o %:p:r.bib %:p:r.aux<CR>", "bib export" }, | ||
c = { "<cmd>:VimtexClearCache All<CR>", "clear vimtex" }, | ||
e = { "<cmd>e ~/.config/nvim/snippets/tex.snippets<CR>", "edit snippets" }, | ||
e = { "<cmd>VimtexErrors<CR>", "error report" }, | ||
f = { "<cmd>lua vim.lsp.buf.format()<CR>", "format" }, | ||
g = { "<cmd>e ~/.config/nvim/templates/Glossary.tex<CR>", "edit glossary" }, | ||
-- h = { "<cmd>lua _HTOP_TOGGLE()<CR>", "htop" }, | ||
h = { "<cmd>LocalHighlightToggle<CR>", "highlight" }, | ||
k = { "<cmd>VimtexClean<CR>", "kill aux" }, | ||
l = { "<cmd>LeanInfoviewToggle<CR>", "lean info" }, | ||
-- l = { "<cmd>lua vim.g.cmptoggle = not vim.g.cmptoggle<CR>", "LSP" }, | ||
-- m = { "<cmd>MarkdownPreview<CR>", "markdown preview" }, | ||
|
||
m = { "<cmd>TermExec cmd='python3 /home/benjamin/Documents/Philosophy/Projects/ModelChecker/Code/src/model_checker %:p:r.py'<CR>", "model checker" }, | ||
p = { "<cmd>TermExec cmd='python %:p:r.py'<CR>", "python" }, | ||
r = { "<cmd>VimtexErrors<CR>", "report errors" }, | ||
r = { "<cmd>AutolistRecalculate<CR>", "reorder list" }, | ||
t = { "<cmd>terminal latexindent -w %:p:r.tex<CR>", "tex format" }, | ||
u = { "<cmd>cd %:p:h<CR>", "update cwd" }, | ||
v = { "<plug>(vimtex-context-menu)", "vimtex menu" }, | ||
w = { "<cmd>VimtexCountWords!<CR>", "word count" }, | ||
-- w = { "<cmd>TermExec cmd='pandoc %:p -o %:p:r.docx'<CR>" , "word"}, | ||
-- s = { "<cmd>lua function() require('cmp_vimtex.search').search_menu() end<CR>" , "search citations" }, | ||
s = { "<cmd>TermExec cmd='ssh [email protected]'<CR>", "ssh" }, | ||
s = { "<cmd>e ~/.config/nvim/snippets/tex.snippets<CR>", "snippets edit" }, | ||
S = { "<cmd>TermExec cmd='ssh [email protected]'<CR>", "ssh" }, | ||
}, | ||
f = { | ||
name = "FIND", | ||
|
@@ -226,6 +229,20 @@ return { | |
v = { "<cmd>TermExec cmd='zathura %:p:r.pdf &' open=0<CR>", "view" }, | ||
-- x = { "<cmd>echo "run: unoconv -f pdf path-to.docx"" , "word to pdf"}, | ||
}, | ||
r = { | ||
name = "RUN", | ||
d = { "function() vim.diagnostic.open_float(0, { scope = 'line', header = false, focus = false }) end", "diagnostics" }, | ||
l = { "vim.diagnostics.setloclist", "locate errors" }, | ||
n = { "function() vim.diagnostic.goto_next{popup_opts = {show_header = false}} end", "next" }, | ||
p = { "function() vim.diagnostic.goto_prev{popup_opts = {show_header = false}} end", "prev" }, | ||
-- map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>') | ||
-- map('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>') | ||
-- map('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>') | ||
-- map('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>') | ||
-- map('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>') | ||
-- map('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>') | ||
-- map('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>')prev{popup_opts = {show_header = false}} end", "previous" }, | ||
}, | ||
s = { | ||
name = "SURROUND", | ||
s = { "<Plug>(nvim-surround-normal)", "surround" }, | ||
|