From 679bd8f95aee19e962b83ab9d5f0b9416c895847 Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 18 Sep 2022 15:10:19 -0700 Subject: [PATCH 1/2] Added Latex support --- home.nix | 4 ++++ programs/neovim/init.lua | 45 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/home.nix b/home.nix index 11c8565..19c231a 100644 --- a/home.nix +++ b/home.nix @@ -37,6 +37,7 @@ exa fd ffmpeg + font-awesome gitAndTools.diff-so-fancy gnupg go @@ -70,6 +71,7 @@ ripgrep ripgrep-all rnix-lsp + rust-analyzer rustup sbt scala-cli @@ -79,6 +81,8 @@ stack sumneko-lua-language-server tealdeer + tectonic + texlab tig tokei tree diff --git a/programs/neovim/init.lua b/programs/neovim/init.lua index 1e1373d..8e2dd7a 100644 --- a/programs/neovim/init.lua +++ b/programs/neovim/init.lua @@ -57,6 +57,11 @@ local function load_plugins() use 'gennaro-tedesco/nvim-jqx' use 'p00f/nvim-ts-rainbow' use 'christoomey/vim-tmux-navigator' + use 'lervag/vimtex' + use { + 'f3fora/nvim-texlabconfig', + run = 'go build' + } end) end @@ -144,6 +149,40 @@ _G.load_config = function() require('dap-python').test_runner = 'pytest' + -- vimtex + vim.g.vimtex_view_method = 'skim' + vim.g.vimtex_compiler_method = 'tectonic' + + -- nvim-texlabconfig + local tex_preview_executable = '/Applications/Skim.app/Contents/SharedSupport/displayline' + local tex_preview_args = {"%l", "%p", "%f"} + local texlab_build_executable = 'tectonic' + local texlab_build_args = { + '-X', + 'compile', + '%f', + '--synctex', + '--keep-logs', + '--keep-intermediates' + } + require('texlabconfig').setup { + cache_activate = true, + cache_filetypes = { 'tex', 'bib' }, + reverse_search_edit_cmd = 'split', + settings = { + texlab = { + build = { + executable = texlab_build_executable, + args = texlab_build_args + }, + forwardSearch = { + executable = tex_preview_executable, + args = tex_preview_args + } + } + } + } + -- nvim-tree require('nvim-tree').setup() @@ -397,7 +436,7 @@ _G.load_config = function() vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gm', 'lua vim.lsp.buf.implementation()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) @@ -423,7 +462,7 @@ _G.load_config = function() end -- Enable the following language servers - local servers = { 'html', 'jdtls', 'jsonls', 'pyright', 'rnix', 'sourcekit', 'tsserver', 'yamlls' } + local servers = { 'html', 'jdtls', 'jsonls', 'pyright', 'rnix', 'rust_analyzer','sourcekit', 'tsserver', 'yamlls' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach } end @@ -471,7 +510,7 @@ _G.load_config = function() }, }, } - require('lspconfig').sumneko_lua.setup(luadev) + nvim_lsp.sumneko_lua.setup(luadev) -- metals vim.g.metals_server_version = '0.11.8' From 7135dddd9a72ab148c4e1aed6ebe2e88aa3c597a Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Sun, 18 Sep 2022 16:56:21 -0700 Subject: [PATCH 2/2] Update fre2 port --- home.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.nix b/home.nix index 19c231a..9fef7ab 100644 --- a/home.nix +++ b/home.nix @@ -282,7 +282,7 @@ rmxcodederived="rm -fr ~/Library/Developer/Xcode/DerivedData"; v="nvim"; sshfre1="ssh salar@fre1.softinio.net"; - sshfre2="ssh -p 2022 salar@fre2.softinio.net"; + sshfre2="ssh -p 22 salar@fre2.softinio.net"; }; };