Compare commits
No commits in common. "master" and "ad50027cd34b87b95f58bfa683f3eebda8b9334c" have entirely different histories.
master
...
ad50027cd3
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
/assign_reviewer @patrick.michl
|
|
14
init.lua
14
init.lua
@ -1,19 +1,7 @@
|
|||||||
require 'plugins'
|
require 'plugins'
|
||||||
|
|
||||||
vim.g.loaded = 1
|
vim.cmd('colorscheme space-vim-dark')
|
||||||
vim.g.loaded_netrwPlugin = 1
|
|
||||||
|
|
||||||
require('onedark').setup {
|
|
||||||
style = 'warmer'
|
|
||||||
}
|
|
||||||
require('onedark').load()
|
|
||||||
vim.cmd('set background=dark')
|
|
||||||
|
|
||||||
require 'lsp'
|
require 'lsp'
|
||||||
require 'completion'
|
|
||||||
require 'treesitter'
|
|
||||||
require 'term'
|
|
||||||
require 'settings'
|
require 'settings'
|
||||||
require 'keys'
|
require 'keys'
|
||||||
require("symbols-outline").setup()
|
|
||||||
require"fidget".setup{}
|
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
local luasnip = require 'luasnip'
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
documentation = true
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
['<Tab>'] = function(fallback)
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n')
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '')
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
['<S-Tab>'] = function(fallback)
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n')
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-jump-prev', true, true, true), '')
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
sources = {
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
{ name = 'buffer' },
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'latex_symbols' },
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
local dap = require('dap')
|
|
||||||
|
|
||||||
dap.adapters.ruby = {
|
|
||||||
type = 'executable';
|
|
||||||
command = 'bundle';
|
|
||||||
args = {'exec', 'readapt', 'stdio'};
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.ruby = {
|
|
||||||
{
|
|
||||||
type = 'ruby';
|
|
||||||
request = 'launch';
|
|
||||||
name = 'Rails';
|
|
||||||
program = 'bundle';
|
|
||||||
programArgs = {'exec', 'rails', 's'};
|
|
||||||
useBundler = true;
|
|
||||||
},
|
|
||||||
}
|
|
34
lua/keys.lua
34
lua/keys.lua
@ -1,33 +1,11 @@
|
|||||||
local key = vim.api.nvim_set_keymap
|
local key = vim.api.nvim_set_keymap
|
||||||
local u = require('utils')
|
local u = require('utils')
|
||||||
|
|
||||||
vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false})]])
|
vim.cmd([[autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif]])
|
||||||
|
vim.cmd([[autocmd BufNewFile,BufRead *.md setlocal filetype=notes]])
|
||||||
|
|
||||||
key('n', ';', ':Telescope find_files<CR>', {})
|
key('n', ';', ':Files<CR>', {})
|
||||||
key('n', '<C-n>', ':NvimTreeToggle<CR>', {})
|
key('', '<C-n>', ':NERDTreeToggle<CR>', {})
|
||||||
key('n', 'gh', '/<c-r>=expand("<cword>")<CR><CR>N', {})
|
|
||||||
|
|
||||||
key('i', '<TAB>', 'pumvisible() ? "<C-n>" : "<Tab>"', { expr = true, silent = true })
|
key('i', '<TAB>', 'pumvisible() ? "<C-n>" : "<Tab>"', {expr = true, silent = true})
|
||||||
key('i', '<S-TAB>', 'pumvisible() ? "<C-p>" : "<S-Tab>"', { expr = true, silent = true })
|
key('i', '<S-TAB>', 'pumvisible() ? "<C-p>" : "<S-Tab>"', {expr = true, silent = true})
|
||||||
key('n', '<leader>g', ':lua require"telescope.builtin".live_grep{}<CR>', {})
|
|
||||||
key('v', '<leader>c', ':w !xclip -sel c<CR><CR>', { silent = true })
|
|
||||||
|
|
||||||
-- Highlight on yank
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
augroup YankHighlight
|
|
||||||
autocmd!
|
|
||||||
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
|
|
||||||
augroup end
|
|
||||||
]] ,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
|
||||||
nested = true,
|
|
||||||
callback = function()
|
|
||||||
if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
|
|
||||||
vim.cmd 'quit'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
31
lua/lsp.lua
31
lua/lsp.lua
@ -1,3 +1,4 @@
|
|||||||
|
require'lspinstall'.setup()
|
||||||
local u = require('utils')
|
local u = require('utils')
|
||||||
local nvim_lsp = require'lspconfig'
|
local nvim_lsp = require'lspconfig'
|
||||||
|
|
||||||
@ -20,9 +21,8 @@ local on_attach = function(client, bufnr)
|
|||||||
buf_set_keymap('n', 'gd', ':lua vim.lsp.buf.definition()<CR>', opts)
|
buf_set_keymap('n', 'gd', ':lua vim.lsp.buf.definition()<CR>', opts)
|
||||||
buf_set_keymap('n', 'ga', ':lua vim.lsp.buf.code_action()<CR>', opts)
|
buf_set_keymap('n', 'ga', ':lua vim.lsp.buf.code_action()<CR>', opts)
|
||||||
buf_set_keymap('n', 'ff', ':lua vim.lsp.buf.formatting()<CR>', opts)
|
buf_set_keymap('n', 'ff', ':lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
buf_set_keymap('n', 'gn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
||||||
|
|
||||||
--require'completion'.on_attach(client)
|
require'completion'.on_attach(client)
|
||||||
|
|
||||||
-- Set highlight colors
|
-- Set highlight colors
|
||||||
local highlights = {
|
local highlights = {
|
||||||
@ -46,32 +46,13 @@ local on_attach = function(client, bufnr)
|
|||||||
underline = true
|
underline = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
require "lsp_signature".on_attach({doc_lines = 0})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- nvim-cmp supports additional completion capabilities
|
local servers = require'lspinstall'.installed_servers()
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
for _, lsp in ipairs(servers) do
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
nvim_lsp[lsp].setup{
|
||||||
|
|
||||||
|
|
||||||
local servers = require'nvim-lsp-installer'
|
|
||||||
servers.on_server_ready(function(server)
|
|
||||||
local config = {
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
|
||||||
flags = {debounce_text_changes = 150}
|
flags = {debounce_text_changes = 150}
|
||||||
}
|
}
|
||||||
if server.name == "sumneko_lua" then
|
end
|
||||||
config.settings = require'lsp.lua'
|
|
||||||
end
|
|
||||||
if server.name == "rust_analyzer" then
|
|
||||||
config.settings = require'lsp.rust'
|
|
||||||
end
|
|
||||||
server:setup(config)
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Set completeopt to have a better completion experience
|
|
||||||
vim.o.completeopt = 'menuone,noselect'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
local M = {
|
|
||||||
Lua = {
|
|
||||||
runtime = {
|
|
||||||
-- LuaJIT in the case of Neovim
|
|
||||||
version = 'LuaJIT',
|
|
||||||
path = vim.split(package.path, ';'),
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
-- Get the language server to recognize the `vim` global
|
|
||||||
globals = {'vim'},
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
-- Make the server aware of Neovim runtime files
|
|
||||||
library = {
|
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
|
||||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
@ -1,19 +0,0 @@
|
|||||||
local M = {
|
|
||||||
['rust-analyzer'] = {
|
|
||||||
assist = {
|
|
||||||
importGranularity = "module",
|
|
||||||
importPrefix = "by_self",
|
|
||||||
},
|
|
||||||
cargo = {
|
|
||||||
loadOutDirsFromCheck = true
|
|
||||||
},
|
|
||||||
procMacro = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
checkOnSave = {
|
|
||||||
command = "clippy"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return M
|
|
@ -1,52 +1,19 @@
|
|||||||
local ensure_packer = function()
|
local vim = vim -- Workaround to get rid of warnings
|
||||||
local fn = vim.fn
|
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
|
||||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
|
||||||
vim.cmd [[packadd packer.nvim]]
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
local packer_bootstrap = ensure_packer()
|
|
||||||
|
|
||||||
vim.cmd([[autocmd BufWritePost plugins.lua source <afile> | PackerCompile]])
|
vim.cmd([[autocmd BufWritePost plugins.lua source <afile> | PackerCompile]])
|
||||||
|
|
||||||
return require('packer').startup({function()
|
return require('packer').startup({function()
|
||||||
local use = use
|
local use = use
|
||||||
-- Packer can manage itself
|
-- Packer can manage itself
|
||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
-- Theme
|
|
||||||
use 'navarasu/onedark.nvim'
|
|
||||||
-- use 'liuchengxu/space-vim-dark'
|
|
||||||
|
|
||||||
use {
|
use 'vim-airline/vim-airline'
|
||||||
'nvim-lualine/lualine.nvim',
|
use 'scrooloose/nerdtree'
|
||||||
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
use 'Xuyuanp/nerdtree-git-plugin'
|
||||||
config = function() require('plugins/lualine') end
|
use 'liuchengxu/space-vim-dark'
|
||||||
}
|
|
||||||
use {
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
requires = "nvim-lua/plenary.nvim",
|
|
||||||
config = function() require("todo-comments").setup()end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
config = function() require("which-key").setup() end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'jremmen/vim-ripgrep',
|
|
||||||
op = true,
|
|
||||||
cmd = { 'Rg' }
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'tpope/vim-dispatch',
|
|
||||||
opt = true,
|
|
||||||
cmd = { 'Dispatch', 'Dispatch!' }
|
|
||||||
}
|
|
||||||
use 'tpope/vim-fugitive'
|
use 'tpope/vim-fugitive'
|
||||||
use 'tpope/vim-commentary'
|
use 'tpope/vim-commentary'
|
||||||
|
use { 'tpope/vim-dispatch', opt = true, cmd = { 'Dispatch', 'Dispatch!' } }
|
||||||
|
use 'junegunn/fzf.vim'
|
||||||
use 'sheerun/vim-polyglot'
|
use 'sheerun/vim-polyglot'
|
||||||
use 'honza/vim-snippets'
|
use 'honza/vim-snippets'
|
||||||
use 'szw/vim-tags'
|
use 'szw/vim-tags'
|
||||||
@ -55,50 +22,15 @@ return require('packer').startup({function()
|
|||||||
use 'tpope/vim-haml'
|
use 'tpope/vim-haml'
|
||||||
use 'xolox/vim-notes'
|
use 'xolox/vim-notes'
|
||||||
use 'xolox/vim-misc'
|
use 'xolox/vim-misc'
|
||||||
|
use 'jremmen/vim-ripgrep'
|
||||||
use 'airblade/vim-gitgutter'
|
use 'airblade/vim-gitgutter'
|
||||||
use 'akinsho/toggleterm.nvim'
|
|
||||||
|
|
||||||
-- LSP Setup
|
-- LSP Setup
|
||||||
use 'neovim/nvim-lspconfig'
|
use 'neovim/nvim-lspconfig'
|
||||||
use 'williamboman/nvim-lsp-installer'
|
use 'kabouzeid/nvim-lspinstall'
|
||||||
use 'nvim-lua/lsp_extensions.nvim'
|
use 'nvim-lua/lsp_extensions.nvim'
|
||||||
use 'ray-x/lsp_signature.nvim'
|
|
||||||
use 'nvim-lua/completion-nvim'
|
use 'nvim-lua/completion-nvim'
|
||||||
use 'nvim-lua/popup.nvim'
|
use 'nvim-lua/popup.nvim'
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
requires = { {'nvim-lua/plenary.nvim'} }
|
|
||||||
}
|
|
||||||
use 'nvim-lua/plenary.nvim'
|
use 'nvim-lua/plenary.nvim'
|
||||||
use 'L3MON4D3/LuaSnip' -- Snippets plugin
|
|
||||||
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
|
|
||||||
use 'hrsh7th/cmp-nvim-lsp'
|
|
||||||
use 'saadparwaiz1/cmp_luasnip'
|
|
||||||
use "hrsh7th/cmp-buffer"
|
|
||||||
use "hrsh7th/cmp-path"
|
|
||||||
use 'kdheepak/cmp-latex-symbols'
|
|
||||||
use 'nvim-treesitter/nvim-treesitter'
|
|
||||||
use 'simrat39/symbols-outline.nvim'
|
|
||||||
use 'j-hui/fidget.nvim'
|
|
||||||
|
|
||||||
use 'kyazdani42/nvim-web-devicons'
|
|
||||||
|
|
||||||
use 'stevearc/dressing.nvim'
|
|
||||||
|
|
||||||
use {
|
|
||||||
'kyazdani42/nvim-tree.lua',
|
|
||||||
cmd = {
|
|
||||||
'NvimTreeOpen',
|
|
||||||
'NvimTreeFocus',
|
|
||||||
'NvimTreeToggle',
|
|
||||||
},
|
|
||||||
config = function() require'plugins/nvim-tree' end
|
|
||||||
}
|
|
||||||
use 'justinmk/vim-sneak'
|
|
||||||
|
|
||||||
if packer_bootstrap then
|
|
||||||
require('packer').sync()
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
config = {
|
config = {
|
||||||
display = {
|
display = {
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
-- Inserts a component in lualine_c at left section
|
|
||||||
local config = {}
|
|
||||||
local function ins_left(component)
|
|
||||||
table.insert(config.sections.lualine_c, component)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Inserts a component in lualine_x ot right section
|
|
||||||
local function ins_right(component)
|
|
||||||
table.insert(config.sections.lualine_x, component)
|
|
||||||
end
|
|
||||||
|
|
||||||
local config = require('lualine').get_config()
|
|
||||||
config.options.theme = 'onedark'
|
|
||||||
require('lualine').setup(config)
|
|
@ -1,33 +0,0 @@
|
|||||||
local tree_cb = require('nvim-tree.config').nvim_tree_callback
|
|
||||||
|
|
||||||
require("nvim-tree").setup {
|
|
||||||
auto_close = true,
|
|
||||||
view = {
|
|
||||||
width = "15%",
|
|
||||||
side = "left",
|
|
||||||
mappings = {
|
|
||||||
custom_only = true,
|
|
||||||
list = {
|
|
||||||
{ key = {"<CR>", "<2-LeftMouse>"}, cb = tree_cb("edit") },
|
|
||||||
{ key = "vs", cb = tree_cb("vsplit") },
|
|
||||||
{ key = "s", cb = tree_cb("split") },
|
|
||||||
{ key = "t", cb = tree_cb("tabnew") },
|
|
||||||
{ key = "<Tab>", cb = tree_cb("preview") },
|
|
||||||
{ key = "K", cb = tree_cb("first_sibling") },
|
|
||||||
{ key = "J", cb = tree_cb("last_sibling") },
|
|
||||||
{ key = "R", cb = tree_cb("refresh") },
|
|
||||||
{ key = "ma", cb = tree_cb("create") },
|
|
||||||
{ key = "md", cb = tree_cb("remove") },
|
|
||||||
{ key = "mm", cb = tree_cb("rename") },
|
|
||||||
{ key = "<C-r>", cb = tree_cb("full_rename") },
|
|
||||||
{ key = "mc", cb = ':lua require"nvim-tree".on_keypress("copy");require"nvim-tree".on_keypress("paste")<CR>' },
|
|
||||||
{ key = "?", cb = tree_cb("toggle_help") },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Hide statusline in nvim-tree buffer/tabs.
|
|
||||||
-- vim.cmd('au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname("%") == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif')
|
|
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
require('telescope').load_extension('fzf')
|
|
@ -7,7 +7,6 @@ cmd('syntax on')
|
|||||||
cmd('set number')
|
cmd('set number')
|
||||||
cmd('set completeopt=menuone,noinsert,noselect')
|
cmd('set completeopt=menuone,noinsert,noselect')
|
||||||
cmd('set shortmess+=c')
|
cmd('set shortmess+=c')
|
||||||
cmd("autocmd CursorHold,CursorHoldI *.rs :lua require'lsp_extensions'.inlay_hints{ only_current_line = true }")
|
|
||||||
|
|
||||||
o.startofline = true
|
o.startofline = true
|
||||||
wo.cursorline = true
|
wo.cursorline = true
|
||||||
@ -25,4 +24,4 @@ bo.shiftwidth = 2
|
|||||||
bo.expandtab = true
|
bo.expandtab = true
|
||||||
|
|
||||||
wo.relativenumber = true
|
wo.relativenumber = true
|
||||||
o.hidden = true
|
|
||||||
|
15
lua/term.lua
15
lua/term.lua
@ -1,15 +0,0 @@
|
|||||||
require("toggleterm").setup{
|
|
||||||
-- size can be a number or function which is passed the current terminal
|
|
||||||
size = 20,
|
|
||||||
open_mapping = [[<c-\>]],
|
|
||||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
|
||||||
shade_filetypes = {},
|
|
||||||
shade_terminals = true,
|
|
||||||
shading_factor = 1, -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
|
|
||||||
start_in_insert = true,
|
|
||||||
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
|
||||||
persist_size = true,
|
|
||||||
direction = 'horizontal',
|
|
||||||
close_on_exit = false, -- close the terminal window when the process exits
|
|
||||||
shell = vim.o.shell, -- change the default shell
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
highlight = {
|
|
||||||
enable = true, -- false will disable the whole extension
|
|
||||||
},
|
|
||||||
incremental_selection = {
|
|
||||||
enable = false,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = 'gnn',
|
|
||||||
node_incremental = 'grn',
|
|
||||||
scope_incremental = 'grc',
|
|
||||||
node_decremental = 'grm',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user