Marty Oehme
981c4cbf10
Added interactive python repl commands with two plugins: Sending repl snippets over with vim-slime and interacting with python (notebook-like) snippets in the editor with vim-ipython-cell. Cells are simply demarcated by `## ` at the beginning of a line, though they can have other syntaxes as well, e.g. `# %% `. By default slime sends its commands over to the last used tmux pane so it is easy to set up a split coding/repl-ing session. Interaction mappings all center around <leader>c + another key. You can send a simple cell with `<leader>cc` or `<leader>C`, single lines or selections with `<leader>cs`. You can switch between cells with `]c` `[c` and insert new ones below/above existing ones with `<leader>co` `<leader>cO` respectively.
223 lines
8 KiB
Lua
223 lines
8 KiB
Lua
local install_path = vim.fn.stdpath("data") .. "/pack/packer/start/packer.nvim"
|
|
|
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
|
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " ..
|
|
install_path)
|
|
end
|
|
|
|
vim.api.nvim_exec([[
|
|
augroup Packer
|
|
autocmd!
|
|
autocmd BufWritePost plugins.lua PackerCompile
|
|
augroup END
|
|
]], false)
|
|
|
|
local use = require("packer").use
|
|
require("packer").startup(function()
|
|
-- packer manages itself
|
|
use "wbthomason/packer.nvim"
|
|
|
|
-- vim plugs
|
|
-- essential
|
|
use {
|
|
'numToStr/Navigator.nvim',
|
|
config = function() require('Navigator').setup() end
|
|
} -- allow seamless navigation between vim buffers and tmux splits
|
|
use 'jeffkreeftmeijer/vim-numbertoggle' -- toggles numbers to absolute for all buffers but the current which is relative
|
|
use 'RRethy/vim-illuminate' -- highlight other occurences of the word under cursor
|
|
use 'ggandor/lightspeed.nvim' -- jump between letters with improved fFtT quicksearch, mimics sneak
|
|
-- use { -- weird errors currently
|
|
-- 'lukas-reineke/indent-blankline.nvim', -- show a vertical line for each indentation
|
|
-- config = function() require('plug._indent-blankline') end
|
|
-- }
|
|
-- files
|
|
use 'vifm/vifm.vim' -- integrate file manager
|
|
use {
|
|
'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter
|
|
requires = {'nvim-lua/plenary.nvim'},
|
|
tag = 'release',
|
|
config = function() require('gitsigns').setup{
|
|
keymaps = {
|
|
['n ]c'] = nil,
|
|
['n [c'] = nil,
|
|
}
|
|
} end,
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'norcalli/nvim-colorizer.lua', -- color hex, named colors in the correct preview scheme
|
|
config = function() require('colorizer').setup() end,
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'mhartington/formatter.nvim', -- auto formatting on save
|
|
config = function() require('plug._format') end,
|
|
event = "BufRead"
|
|
}
|
|
|
|
-- editing
|
|
use {'tpope/vim-commentary', event = "BufRead"} -- easily toggle comments for lines, paragraphs etc with gc
|
|
use {
|
|
'blackCauldron7/surround.nvim', -- lets you change surrounding things with cs (or ds to del, ys to add)
|
|
config = function()
|
|
vim.g.surround_mappings_style = "surround"
|
|
vim.g.surround_pairs = {
|
|
nestable = {{'(', ')'}, {'[', ']'}, {'{', '}'}},
|
|
linear = {{"'", "'"}, {'"', '"'}, {'*', '*'}, {'`', '`'}}
|
|
}
|
|
require('surround').setup {}
|
|
end,
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'monaqa/dial.nvim', -- extend the ^a / ^x possibilities to dates, hex, alphabets, markdown headers
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'tommcdo/vim-exchange', -- adds exchange operator with cx. common use: cxiw . on 2 words to switch
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'windwp/nvim-autopairs',
|
|
config = function() require('plug._autopair') end,
|
|
event = "BufRead"
|
|
} -- Auto close brackets and ''
|
|
use {
|
|
'junegunn/vim-easy-align', -- Align tables and other alignable things
|
|
event = "BufRead"
|
|
}
|
|
use {
|
|
'tversteeg/registers.nvim', -- Show the contents of regiseters on pasting from '', @, <C-R>
|
|
event = "BufRead"
|
|
}
|
|
use { -- highlight where the cursor jumps to
|
|
'edluffy/specs.nvim',
|
|
config = function() require('specs').setup {} end,
|
|
event = "BufRead"
|
|
}
|
|
|
|
-- colorschemes
|
|
use 'norcalli/nvim-base16.lua'
|
|
|
|
-- statusline
|
|
use {
|
|
'glepnir/galaxyline.nvim',
|
|
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
|
config = function() require('plug._galaxyline') end
|
|
}
|
|
|
|
-- writing
|
|
use {'vim-pandoc/vim-pandoc-syntax', ft = 'pandoc'}
|
|
use {'vim-pandoc/vim-pandoc', ft = 'pandoc'}
|
|
use 'micarmst/vim-spellsync' -- personal dict improvements for git sync
|
|
use { -- provide distraction free writing
|
|
'Pocco81/TrueZen.nvim',
|
|
config = function()
|
|
require("true-zen").setup({
|
|
integrations = {
|
|
gitsigns = true,
|
|
galaxyline = true,
|
|
tmux = {global = false},
|
|
limelight = true
|
|
}
|
|
})
|
|
end
|
|
}
|
|
use {'junegunn/limelight.vim', event = 'BufRead'} -- provide even distraction free-er writing (lowlight paragraphs)
|
|
use 'alok/notational-fzf-vim' -- quickly search through the wiki
|
|
|
|
-- languages
|
|
use {'euclidianAce/BetterLua.vim', ft = 'lua'} -- better syntax highlighting for lua
|
|
|
|
-- REPL work
|
|
use {
|
|
'jpalardy/vim-slime', -- send arbitrary code chunks to REPLs
|
|
ft = "python",
|
|
config = function()
|
|
vim.g.slime_target = 'tmux'
|
|
vim.g.slime_default_config = {socket_name = "default", target_pane = "{last}"}
|
|
vim.g.slime_python_ipython = 1
|
|
vim.g.slime_no_mappings = 1
|
|
end,
|
|
}
|
|
use { 'hanschen/vim-ipython-cell', -- send code 'cells' to REPL
|
|
ft = "python",
|
|
config = function()
|
|
vim.g.ipython_cell_highlight_cells_ft = {'python'}
|
|
vim.g.ipython_cell_insert_tag = "## Cell"
|
|
end,
|
|
}
|
|
|
|
--
|
|
-- nvim plugs
|
|
use 'Iron-E/nvim-cartographer' -- makes it easier to set mappings through lua
|
|
use 'marty-oehme/zettelkasten.nvim' -- simple static markdown linking
|
|
use {
|
|
"akinsho/nvim-toggleterm.lua", -- simpler, programmable and multiple terminal toggling for nvim
|
|
event = "BufWinEnter",
|
|
config = function() require('plug._toggleterm') end
|
|
}
|
|
|
|
-- fuzzy matching
|
|
use {
|
|
"nvim-telescope/telescope.nvim",
|
|
requires = {{"nvim-lua/popup.nvim"}, {"nvim-lua/plenary.nvim"}},
|
|
config = function() require('plug._telescope') end
|
|
}
|
|
use "nvim-telescope/telescope-fzy-native.nvim"
|
|
use "nvim-telescope/telescope-fzf-writer.nvim"
|
|
|
|
-- lsp
|
|
use 'neovim/nvim-lspconfig' -- some commong language server configurations
|
|
use 'tami5/lspsaga.nvim' -- nice and fast ui for lsp actions WILL HAVE TO BE REPLACED SOON
|
|
use 'simrat39/symbols-outline.nvim' -- vista-like outline view for code
|
|
use 'ray-x/lsp_signature.nvim'
|
|
-- and completion
|
|
use {
|
|
'hrsh7th/nvim-cmp', -- simple completion engine built specifically for nvim and lsp
|
|
requires = {
|
|
'onsails/lspkind-nvim', 'andersevenrud/cmp-tmux', -- completion source from adjacent tmux panes
|
|
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path',
|
|
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-vsnip',
|
|
'kdheepak/cmp-latex-symbols', 'ray-x/cmp-treesitter',
|
|
'f3fora/cmp-spell', 'jc-doyle/cmp-pandoc-references',
|
|
'cbarrete/completion-vcard'
|
|
}
|
|
}
|
|
-- snippeting
|
|
use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine
|
|
use {"rafamadriz/friendly-snippets", event = "InsertEnter"} -- many snippets
|
|
|
|
require('plug._lsp')
|
|
|
|
-- treesitter
|
|
use {
|
|
'nvim-treesitter/nvim-treesitter',
|
|
run = ':TSUpdate',
|
|
config = function() require('plug._treesitter') end
|
|
}
|
|
use 'nvim-treesitter/playground' -- interactively view and query the treesitter tree
|
|
use 'romgrk/nvim-treesitter-context' -- show current cursor context at top of buffer
|
|
use {
|
|
'RRethy/nvim-treesitter-textsubjects', -- allows using . and ; to target treesitter branches
|
|
config = function()
|
|
require'nvim-treesitter.configs'.setup {
|
|
textsubjects = {
|
|
enable = true,
|
|
keymaps = {
|
|
['.'] = 'textsubjects-smart',
|
|
[';'] = 'textsubjects-container-outer'
|
|
}
|
|
}
|
|
}
|
|
end
|
|
}
|
|
use 'p00f/nvim-ts-rainbow' -- rainbow brackets using treesitter
|
|
use 'JoosepAlviste/nvim-ts-context-commentstring' -- improves commenting plugin above by using ts
|
|
use {
|
|
'lewis6991/spellsitter.nvim', -- uses treesitter to highlight spelling errors
|
|
config = function() require('spellsitter').setup() end
|
|
}
|
|
|
|
end)
|