Compare commits
No commits in common. "981c4cbf10998a0899f5b8b89b0034bd9150691b" and "65be7e8eac9135c22af4a37cc5a05392c1cc8fc4" have entirely different histories.
981c4cbf10
...
65be7e8eac
6 changed files with 53 additions and 171 deletions
|
@ -45,11 +45,6 @@
|
||||||
[url "git@gitlab.com:"]
|
[url "git@gitlab.com:"]
|
||||||
pushInsteadOf = "https://gitlab.com"
|
pushInsteadOf = "https://gitlab.com"
|
||||||
pushInsteadOf = "http://gitlab.com"
|
pushInsteadOf = "http://gitlab.com"
|
||||||
[url "git@git.martyoeh.me:"]
|
|
||||||
pushInsteadOf = "https://git.martyoeh.me"
|
|
||||||
pushInsteadOf = "http://git.martyoeh.me"
|
|
||||||
pushInsteadOf = "git@martyoeh.me"
|
|
||||||
pullInsteadOf = "git@martyoeh.me"
|
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
|
|
|
@ -71,14 +71,16 @@ map.n.nore[']a'] = ':next<cr>'
|
||||||
map.n.nore['[b'] = ':bprevious<cr>'
|
map.n.nore['[b'] = ':bprevious<cr>'
|
||||||
map.n.nore[']b'] = ':bnext<cr>'
|
map.n.nore[']b'] = ':bnext<cr>'
|
||||||
-- Quickfix list
|
-- Quickfix list
|
||||||
map.n.nore['[q'] = ':cprevious<cr>'
|
map.n.nore['[c'] = ':cprevious<cr>'
|
||||||
map.n.nore[']q'] = ':cnext<cr>'
|
map.n.nore[']c'] = ':cnext<cr>'
|
||||||
-- Location list
|
-- Location list
|
||||||
map.n.nore['[l'] = ':lprevious<cr>'
|
map.n.nore['[l'] = ':lprevious<cr>'
|
||||||
map.n.nore[']l'] = ':lnext<cr>'
|
map.n.nore[']l'] = ':lnext<cr>'
|
||||||
-- Hunks (from gitsigns)
|
-- Hunks (from gitsigns)
|
||||||
map.n.nore.expr['[h'] = [[&diff ? ']c' : '<cmd>Gitsigns prev_hunk<CR>']]
|
map.n.nore.expr['[h'] =
|
||||||
map.n.nore.expr[']h'] = [[&diff ? '[c' : '<cmd>Gitsigns next_hunk<CR>']]
|
[[&diff ? ']c' : '<cmd>lua require("gitsigns.actions").prev_hunk()<CR>']]
|
||||||
|
map.n.nore.expr[']h'] =
|
||||||
|
[[&diff ? '[c' : '<cmd>lua require("gitsigns.actions").next_hunk()<CR>']]
|
||||||
|
|
||||||
-- set our leader key to space since with hjkl, space is largely useless
|
-- set our leader key to space since with hjkl, space is largely useless
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
@ -255,22 +257,3 @@ map.n.nore['<leader>ww'] = [[:lua require 'zettelkasten'.open_index()<cr> ]]
|
||||||
-- PLUGIN: toggleterm.nvim
|
-- PLUGIN: toggleterm.nvim
|
||||||
-- create a lazygit window, set up in toggleterm settings
|
-- create a lazygit window, set up in toggleterm settings
|
||||||
map.n.nore['<leader>G'] = ':Lazygit<cr>'
|
map.n.nore['<leader>G'] = ':Lazygit<cr>'
|
||||||
|
|
||||||
-- PLUGIN: slime and ipython-cell
|
|
||||||
-- send line / region, not adhering to cells
|
|
||||||
map.n['<leader>cs'] = '<Plug>SlimeLineSend'
|
|
||||||
map.x['<leader>cs'] = '<Plug>SlimeRegionSend'
|
|
||||||
-- send complete script to repl / benchmark execution
|
|
||||||
map.n.nore['<leader>cr'] = ':IPythonCellRun<cr>'
|
|
||||||
map.n.nore['<leader>cR'] = ':IPythonCellRunTime<cr>'
|
|
||||||
-- send current cell / send and go to next
|
|
||||||
map.n.nore['<leader>cc'] = ':IPythonCellExecuteCellVerbose<cr>'
|
|
||||||
map.n.nore['<leader>C'] = ':IPythonCellExecuteCellVerboseJump<cr>'
|
|
||||||
-- clear ipython repl
|
|
||||||
map.n.nore['<leader>cl'] = ':IPythonCellClear<cr>'
|
|
||||||
-- jump to previous/ next cell
|
|
||||||
map.n.nore[']c'] = ':IPythonCellNextCell<cr>'
|
|
||||||
map.n.nore['[c'] = ':IPythonCellPrevCell<cr>'
|
|
||||||
-- insert cell header above/below
|
|
||||||
map.n.nore['<leader>cO'] = ':IPythonCellInsertAbove<cr>a'
|
|
||||||
map.n.nore['<leader>co'] = ':IPythonCellInsertBelow<cr>a'
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
require('nvim-autopairs').setup({check_ts = true})
|
require('nvim-autopairs').setup({check_ts = true})
|
||||||
|
require("nvim-autopairs.completion.compe").setup({
|
||||||
|
map_cr = true, -- map <CR> on insert mode
|
||||||
|
map_complete = true -- it will auto insert `(` after select function or method item
|
||||||
|
})
|
||||||
|
|
||||||
--- Auto-space rules
|
--- Auto-space rules
|
||||||
local npairs = require 'nvim-autopairs'
|
local npairs = require 'nvim-autopairs'
|
||||||
|
@ -10,9 +14,3 @@ npairs.add_rules {
|
||||||
return vim.tbl_contains({'()', '[]', '{}'}, pair)
|
return vim.tbl_contains({'()', '[]', '{}'}, pair)
|
||||||
end)
|
end)
|
||||||
}
|
}
|
||||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
|
||||||
local cmp = require('cmp')
|
|
||||||
cmp.event:on('confirm_done',
|
|
||||||
cmp_autopairs.on_confirm_done({map_char = {tex = ''}}))
|
|
||||||
-- add a lisp filetype (wrap my-function), FYI: Hardcoded = { "clojure", "clojurescript", "fennel", "janet" }
|
|
||||||
cmp_autopairs.lisp[#cmp_autopairs.lisp + 1] = "racket"
|
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
-- Settings for indentBlankline
|
-- Settings for indentBlankline
|
||||||
-- turn off for diff views since we want to compare directly
|
-- turn off for diff views since we want to compare directly
|
||||||
if vim.wo.diff then vim.g["indent_blankline_enabled"] = false end
|
if vim.wo.diff then
|
||||||
|
vim.g["indent_blankline_enabled"] = false
|
||||||
|
end
|
||||||
|
|
||||||
vim.g.indent_blankline_char = "▏"
|
vim.g.indent_blankline_char = "▏"
|
||||||
|
|
||||||
vim.g.indent_blankline_filetype_exclude = {
|
vim.g.indent_blankline_filetype_exclude = {
|
||||||
"help", "undotree", "markdown", "text", "pandoc", "rst", "asciidoc",
|
"help", "undotree",
|
||||||
|
"markdown", "text", "pandoc", "rst", "asciidoc",
|
||||||
"vim-plug"
|
"vim-plug"
|
||||||
}
|
}
|
||||||
vim.g.indent_blankline_buftype_exclude = {"terminal"}
|
vim.g.indent_blankline_buftype_exclude = {"terminal"}
|
||||||
|
|
|
@ -2,23 +2,7 @@ local api = vim.api
|
||||||
|
|
||||||
local saga = require 'lspsaga'
|
local saga = require 'lspsaga'
|
||||||
local lspcfg = require 'lspconfig'
|
local lspcfg = require 'lspconfig'
|
||||||
local cmp = require 'cmp'
|
local compe = require 'compe'
|
||||||
local lspkind = require 'lspkind'
|
|
||||||
|
|
||||||
require"lsp_signature".setup()
|
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and
|
|
||||||
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col,
|
|
||||||
col)
|
|
||||||
:match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local feedkey = function(key, mode)
|
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true),
|
|
||||||
mode, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Enable the following language servers
|
-- Enable the following language servers
|
||||||
local servers = {
|
local servers = {
|
||||||
|
@ -26,77 +10,35 @@ local servers = {
|
||||||
-- sumneko_lua further down, needs more setup
|
-- sumneko_lua further down, needs more setup
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.o.completeopt = "menu,menuone,noselect"
|
vim.o.completeopt = "menuone,noselect"
|
||||||
|
-- completion sources, higher priority = closer to the top?
|
||||||
-- completion items
|
compe.setup({
|
||||||
require('cmp').register_source('vCard', require('completion_vcard').setup_cmp(
|
source = {
|
||||||
'~/documents/contacts/myconts'))
|
nvim_lsp = {kind = ""},
|
||||||
vim.g.vsnip_snippet_dir = (vim.env.XDG_DATA_HOME or "~/.local/share") ..
|
nvim_treesitter = {kind = "⧻"},
|
||||||
"/nvim/snippets"
|
buffer = {kind = ""},
|
||||||
cmp.setup({
|
path = {kind = ""},
|
||||||
snippet = {expand = function(args) vim.fn["vsnip#anonymous"](args.body) end},
|
calc = {kind = ""},
|
||||||
mapping = {
|
nvim_lua = true,
|
||||||
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), {'i', 'c'}),
|
emoji = {
|
||||||
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}),
|
kind = "ﲃ",
|
||||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}),
|
filetypes = {"markdown", "text", "pandoc", "rst", "asciidoc"}
|
||||||
['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
},
|
||||||
['<C-e>'] = cmp.mapping({
|
latex_symbols = {
|
||||||
i = cmp.mapping.abort(),
|
kind = "λ",
|
||||||
c = cmp.mapping.close()
|
filetypes = {"markdown", "text", "pandoc", "rst", "asciidoc"}
|
||||||
}),
|
},
|
||||||
-- Accept currently selected item. If none selected, `select` first item.
|
tmux = {kind = "τ"},
|
||||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
spell = {kind = "", priority = 0},
|
||||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
vsnip = true
|
||||||
["<C-n>"] = cmp.mapping(function(fallback)
|
}
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
|
||||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, {"i", "s"}),
|
|
||||||
|
|
||||||
["<C-p>"] = cmp.mapping(function()
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
|
||||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
|
||||||
end
|
|
||||||
end, {"i", "s"})
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
with_text = false,
|
|
||||||
menu = ({
|
|
||||||
buffer = "B",
|
|
||||||
nvim_lua = "NLua",
|
|
||||||
tmux = "τ",
|
|
||||||
vCard = "VCARD"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{name = 'path'}, {name = 'nvim_lsp'}, {name = 'treesitter'},
|
|
||||||
{name = 'tmux'}, {name = 'vsnip'}, {name = 'latex_symbols'},
|
|
||||||
{name = 'pandoc_references'}, {name = 'vCard'}
|
|
||||||
}, {{name = 'buffer'}, {name = 'spell'}})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use buffer source for `/` search
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
||||||
-- Use cmdline & path source for ':' in vim
|
properties = {'documentation', 'detail', 'additionalTextEdits'}
|
||||||
cmp.setup.cmdline(':', {
|
}
|
||||||
sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Setup lspconfig.
|
|
||||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp
|
|
||||||
.protocol
|
|
||||||
.make_client_capabilities())
|
|
||||||
|
|
||||||
local on_attach = function(_, _)
|
local on_attach = function(_, _)
|
||||||
-- Keybindings for LSPs
|
-- Keybindings for LSPs
|
||||||
|
@ -167,9 +109,7 @@ local on_attach = function(_, _)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set up simple servers
|
-- set up simple servers
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do lspcfg[lsp].setup {on_attach = on_attach} end
|
||||||
lspcfg[lsp].setup {on_attach = on_attach, capabilities = capabilities}
|
|
||||||
end
|
|
||||||
|
|
||||||
lspcfg.efm.setup {
|
lspcfg.efm.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
|
@ -26,22 +26,16 @@ require("packer").startup(function()
|
||||||
use 'jeffkreeftmeijer/vim-numbertoggle' -- toggles numbers to absolute for all buffers but the current which is relative
|
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 '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 'ggandor/lightspeed.nvim' -- jump between letters with improved fFtT quicksearch, mimics sneak
|
||||||
-- use { -- weird errors currently
|
use 'lukas-reineke/indent-blankline.nvim' -- show a vertical line for each indentation
|
||||||
-- 'lukas-reineke/indent-blankline.nvim', -- show a vertical line for each indentation
|
require('plug._indent-blankline')
|
||||||
-- config = function() require('plug._indent-blankline') end
|
|
||||||
-- }
|
|
||||||
-- files
|
-- files
|
||||||
use 'vifm/vifm.vim' -- integrate file manager
|
use 'vifm/vifm.vim' -- integrate file manager
|
||||||
use {
|
use {
|
||||||
'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter
|
'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter
|
||||||
requires = {'nvim-lua/plenary.nvim'},
|
requires = {'nvim-lua/plenary.nvim'},
|
||||||
tag = 'release',
|
tag = 'release',
|
||||||
config = function() require('gitsigns').setup{
|
config = function() require('gitsigns').setup() end,
|
||||||
keymaps = {
|
|
||||||
['n ]c'] = nil,
|
|
||||||
['n [c'] = nil,
|
|
||||||
}
|
|
||||||
} end,
|
|
||||||
event = "BufRead"
|
event = "BufRead"
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
|
@ -129,27 +123,9 @@ require("packer").startup(function()
|
||||||
-- languages
|
-- languages
|
||||||
use {'euclidianAce/BetterLua.vim', ft = 'lua'} -- better syntax highlighting for lua
|
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
|
-- nvim plugs
|
||||||
|
|
||||||
use 'Iron-E/nvim-cartographer' -- makes it easier to set mappings through lua
|
use 'Iron-E/nvim-cartographer' -- makes it easier to set mappings through lua
|
||||||
use 'marty-oehme/zettelkasten.nvim' -- simple static markdown linking
|
use 'marty-oehme/zettelkasten.nvim' -- simple static markdown linking
|
||||||
use {
|
use {
|
||||||
|
@ -169,21 +145,12 @@ require("packer").startup(function()
|
||||||
|
|
||||||
-- lsp
|
-- lsp
|
||||||
use 'neovim/nvim-lspconfig' -- some commong language server configurations
|
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 'tami5/lspsaga.nvim' -- nice and fast ui for lsp actions
|
||||||
use 'simrat39/symbols-outline.nvim' -- vista-like outline view for code
|
use 'simrat39/symbols-outline.nvim' -- vista-like outline view for code
|
||||||
use 'ray-x/lsp_signature.nvim'
|
|
||||||
-- and completion
|
-- and completion
|
||||||
use {
|
use 'hrsh7th/nvim-compe' -- simple completion engine built specifically for nvim and lsp
|
||||||
'hrsh7th/nvim-cmp', -- simple completion engine built specifically for nvim and lsp
|
use 'GoldsteinE/compe-latex-symbols' -- adding unicode symbols for latex (/pandoc) files
|
||||||
requires = {
|
use {'andersevenrud/compe-tmux', branch = 'compe' } -- completion source from adjacent tmux panes
|
||||||
'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
|
-- snippeting
|
||||||
use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine
|
use {"hrsh7th/vim-vsnip", event = "InsertEnter"} -- snippet engine
|
||||||
use {"rafamadriz/friendly-snippets", event = "InsertEnter"} -- many snippets
|
use {"rafamadriz/friendly-snippets", event = "InsertEnter"} -- many snippets
|
||||||
|
@ -214,9 +181,5 @@ require("packer").startup(function()
|
||||||
}
|
}
|
||||||
use 'p00f/nvim-ts-rainbow' -- rainbow brackets using treesitter
|
use 'p00f/nvim-ts-rainbow' -- rainbow brackets using treesitter
|
||||||
use 'JoosepAlviste/nvim-ts-context-commentstring' -- improves commenting plugin above by using ts
|
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)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue