neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim.git
Log | Files | Refs

commit d74886584b75580469d4c4bed3d6eb8d7eda297e
parent a0133534ac989d315d0f8007c435bb56db9a8a2c
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Fri, 15 Oct 2021 09:20:53 +0200

update

Diffstat:
Mftplugin/dart.lua | 2+-
Minit.lua | 46++++++++++++++++++++++++++++++----------------
Mlua/tms/plugins.lua | 203++++++++++++-------------------------------------------------------------------
3 files changed, 61 insertions(+), 190 deletions(-)

diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua @@ -3,7 +3,7 @@ local kb = require('tms.c.keybind') vim.g.dart_style_guide = 2 vim.g.dart_html_in_string = true -vim.cmd [[command! -buffer DartAnalyzer lua require('tms.ft.dart.analyze').qf2103()]] +vim.cmd [[command! -buffer DartAnalyzer lua require('tms.ft.dart.analyze').qf2131()]] vim.cmd [[command! -buffer DartDebug lua require('tms.ft.dart.debug').func()]] vim.cmd [[command! -buffer DartPrint lua require('tms.ft.dart.debug').print()]] vim.cmd [[command! -buffer DartOrganizeImports lua require('tms.ft.dart.lsp').organize_imports()]] diff --git a/init.lua b/init.lua @@ -1,9 +1,7 @@ -local install_path = vim.fn.stdpath('data') .. - '/site/pack/packer/opt/packer.nvim' +local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim' if vim.fn.empty(vim.fn.glob(install_path)) > 0 then - vim.api.nvim_command( - '!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) + vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) end local colors = require('tms.colors') @@ -54,6 +52,8 @@ vim.opt.foldlevel = 999 vim.opt.foldmethod = 'indent' vim.opt.foldtext = 'MyFoldText()' vim.opt.list = false +vim.opt.laststatus = 0 +vim.opt.statusline = ' ' vim.opt.listchars = { space = '·', tab = '» ', @@ -63,7 +63,10 @@ vim.opt.listchars = { trail = '_', eol = '$', } -vim.opt.fillchars = {eob = '•', fold = ' '} +vim.opt.fillchars = { + eob = '•', + fold = ' ', +} vim.opt.number = false vim.opt.scrolloff = 5 vim.opt.sidescrolloff = 5 @@ -79,7 +82,11 @@ local inoremap = kb.inoremap -- forget visual nmap {'Q', '<nop>'} -- kb.nnoremap('<tab>', 'za') -nmap {'<esc>', '<cmd>nohl<cr>', silent = true} +nmap { + '<esc>', + '<cmd>nohl<cr>', + silent = true, +} nnoremap {'gA', 'ga'} nnoremap {'Y', 'y$'} nnoremap {'n', 'nzzzv'} @@ -115,9 +122,21 @@ nnoremap {'<a-J>', '<c-w>J'} nnoremap {'<a-K>', '<c-w>K'} nnoremap {'<a-L>', '<c-w>L'} -- window split -nnoremap {'<c-w><c-s>', require('tms.p.vifm').split, silent = true} -nnoremap {'<c-w><c-v>', require('tms.p.vifm').vsplit, silent = true} -nnoremap {'<c-w><c-w>', require('tms.p.vifm').current, silent = true} +nnoremap { + '<c-w><c-s>', + require('tms.p.vifm').split, + silent = true, +} +nnoremap { + '<c-w><c-v>', + require('tms.p.vifm').vsplit, + silent = true, +} +nnoremap { + '<c-w><c-w>', + require('tms.p.vifm').current, + silent = true, +} nnoremap {'<c-w>V', '<cmd>vnew<cr>'} nnoremap {'<c-w>S', '<cmd>new<cr>'} -- line movement @@ -166,13 +185,8 @@ au.addListeners({ [[BufWritePost *.bin set nomod | endif]], }, ['user-vifm'] = {[[BufEnter vifm:* startinsert]]}, - ['user-cursorline'] = { - [[WinEnter * setlocal cursorline]], - [[WinLeave * setlocal nocursorline]], - }, - ['user-yank-high'] = { - [[TextYankPost * silent! lua require'vim.highlight'.on_yank()]], - }, + ['user-cursorline'] = {[[WinEnter * setlocal cursorline]], [[WinLeave * setlocal nocursorline]]}, + ['user-yank-high'] = {[[TextYankPost * silent! lua require'vim.highlight'.on_yank()]]}, ['user-colorscheme'] = { [[ColorScheme * lua require('tms.u.reload').colors()]], [[ColorSchemePre * lua require('tms.u.reload').colorsPre()]], diff --git a/lua/tms/plugins.lua b/lua/tms/plugins.lua @@ -8,10 +8,7 @@ local function init() local use = packer.use packer.reset() - use { - 'wbthomason/packer.nvim', - opt = true, - } + use {'wbthomason/packer.nvim', opt = true} use 'lewis6991/impatient.nvim' -- spell @@ -22,17 +19,6 @@ local function init() use 'tpope/vim-eunuch' -- usefull unix utililties cmds use 'machakann/vim-sandwich' -- surround use { -- auto pairs - disable = true, - 'tmsvg/pear-tree', - config = function() - -- " Smart pairs are disabled by default: - vim.g.pear_tree_smart_openers = 1 - vim.g.pear_tree_smart_closers = 1 - vim.g.pear_tree_smart_backspace = 1 - vim.g.pear_tree_ft_disabled = {'TelescopePrompt'} - end, - } - use { -- auto pairs 'cohama/lexima.vim', config = function() vim.g.lexima_map_escape = '' @@ -41,14 +27,7 @@ local function init() end, } use 'michaeljsmith/vim-indent-object' - use { - 'b3nj5m1n/kommentary', - config = function() - require('kommentary.config').configure_language('default', { - prefer_single_line_comments = true, - }) - end, - } + use {'numToStr/Comment.nvim', config = function() require('Comment').setup() end} use { -- undo tree 'mbbill/undotree', config = function() @@ -62,9 +41,7 @@ local function init() 'camspiers/animate.vim', config = function() vim.cmd('let g:animate#duration = 100.0') - local silent = { - silent = true, - } + local silent = {silent = true} local kb = require('tms.c.keybind') kb.nmap('<c-up>', ':call animate#window_delta_height(10)<cr>', silent) kb.nmap('<c-down>', ':call animate#window_delta_height(-10)<cr>', silent) @@ -123,27 +100,22 @@ local function init() } -- highlight parens use 'chaoren/vim-wordmotion' -- word counts with _,.,-,... use { + disable = true, 'hoob3rt/lualine.nvim', - requires = { - 'kyazdani42/nvim-web-devicons', - opt = true, - }, + requires = {'kyazdani42/nvim-web-devicons', opt = true}, config = function() require('tms.p.status').setup() end, } - use {'joeytwiddle/sexy_scroller.vim'} -- smooth scrolling + use {disable = true, 'joeytwiddle/sexy_scroller.vim'} -- smooth scrolling use { - disable = true, '~/.local/lib/neoscroll.nvim', config = function() - require('neoscroll').setup() + require('neoscroll').setup({mappings = {'<C-u>', '<C-d>', '<C-b>', '<C-f>', 'zt', 'zz', 'zb'}}) local t = {} -- Syntax: t[keys] = {function , {function arguments}} t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '80'}} t['<C-d>'] = {'scroll', {'vim.wo.scroll', 'true', '80'}} t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '100'}} t['<C-f>'] = {'scroll', {'vim.api.nvim_win_get_height(0)', 'true', '100'}} - t['<C-y>'] = {'scroll', {'-0.10', 'false', '100'}} - t['<C-e>'] = {'scroll', {'0.10', 'false', '100'}} t['zt'] = {'zt', {'100'}} t['zz'] = {'zz', {'100'}} t['zb'] = {'zb', {'100'}} @@ -193,45 +165,9 @@ local function init() end, } -- replace use {'tjdevries/astronauta.nvim'} - use { - 'vhyrro/neorg', - requires = {'nvim-lua/plenary.nvim'}, - config = function() - require('neorg').setup { - load = { - ['core.defaults'] = {}, - }, - ['core.norg.concealer'] = {}, - ['core.norg.completion'] = { - config = { - engine = 'nvim-compe', - }, - }, - ['core.norg.dirman'] = { -- Manage your directories with Neorg - config = { - workspaces = { - my_workspace = '~/.neorg', - }, - }, - }, - } - end, - } -- quickfix list - use { - disable = true, - 'romainl/vim-qf', - config = function() - vim.g.qf_mapping_ack_style = 0 - vim.g.qf_auto_open_quickfix = 0 - vim.g.qf_auto_resize = 0 - end, - } - use { - 'kevinhwang91/nvim-bqf', - config = function() require('tms.p.bqf').setup() end, - } + use {'kevinhwang91/nvim-bqf', config = function() require('tms.p.bqf').setup() end} -- distraction use 'junegunn/limelight.vim' @@ -270,19 +206,6 @@ local function init() } use 'sindrets/diffview.nvim' -- view diffs for multiple files use { - 'TimUntersberger/neogit', - requires = {'nvim-lua/plenary.nvim', 'sindrets/diffview.nvim'}, - config = function() - require('neogit').setup { - integrations = { - diffview = true, - }, - } - local kb = require('tms.c.keybind') - kb.nnoremap('<leader>gn', '<cmd>Neogit kind=split<cr>') - end, - } -- git integration - use { 'tpope/vim-fugitive', config = function() local kb = require('tms.c.keybind') @@ -300,10 +223,7 @@ local function init() } -- git info for current line -- colorscheme - use { - 'ishan9299/nvim-solarized-lua', - config = function() end, - } + use {'ishan9299/nvim-solarized-lua', config = function() end} use { 'morhetz/gruvbox', config = function() @@ -329,10 +249,7 @@ local function init() } -- http - use { - disable = true, - 'nicwest/vim-http', - } + use {disable = true, 'nicwest/vim-http'} use { 'NTBBloodbath/rest.nvim', requires = {'nvim-lua/plenary.nvim'}, @@ -350,18 +267,10 @@ local function init() -- file manager -- use {'junegunn/fzf'} -- use {'junegunn/fzf.vim', config = function() vim.g.fzf_buffers_jump = 1 end} - use { - 'vifm/vifm.vim', - config = function() - vim.g.vifm_replace_netrw = true - end, - } + use {'vifm/vifm.vim', config = function() vim.g.vifm_replace_netrw = true end} -- tasks - use { - 'amirrezaask/actions.nvim', - config = function() require('tms.p.actions').setup() end, - } + use {'amirrezaask/actions.nvim', config = function() require('tms.p.actions').setup() end} use { 'skywind3000/asyncrun.vim', config = function() @@ -381,30 +290,15 @@ local function init() } use 'tikhomirov/vim-glsl' use 'mattn/emmet-vim' - use { - 'windwp/nvim-ts-autotag', - config = function() require('nvim-ts-autotag').setup {} end, - } -- html tag autoclose/rename - use { - 'vim-php/vim-composer', - config = function() vim.g.composer_cmd = 'composer' end, - } + use {'windwp/nvim-ts-autotag', config = function() require('nvim-ts-autotag').setup {} end} -- html tag autoclose/rename + use {'vim-php/vim-composer', config = function() vim.g.composer_cmd = 'composer' end} use 'fpob/nette.vim' use 'baskerville/vim-sxhkdrc' - use { - 'dart-lang/dart-vim-plugin', - ft = {'dart'}, - } - use { - 'akinsho/dependency-assist.nvim', - config = function() require'dependency_assist'.setup() end, - } + use {'dart-lang/dart-vim-plugin', ft = {'dart'}} + use {'akinsho/dependency-assist.nvim', config = function() require'dependency_assist'.setup() end} -- snippets - use { - 'norcalli/snippets.nvim', - config = function() require('tms.p.snippets').setup() end, - } + use {'norcalli/snippets.nvim', config = function() require('tms.p.snippets').setup() end} -- completion use { @@ -414,42 +308,20 @@ local function init() require('tms.p.compe').setup() local kb = require('tms.c.keybind') -- kb.inoremap('<c-space>', 'compe#complete()', {silent = true, expr = true}) - kb.inoremap('<cr>', 'compe#confirm("<cr>")', { - silent = true, - expr = true, - }) - kb.inoremap('<c-e>', 'compe#close("<c-e>")', { - silent = true, - expr = true, - }) - kb.imap('<Tab>', 'v:lua.tab_complete()', { - expr = true, - }) - kb.smap('<Tab>', 'v:lua.tab_complete()', { - expr = true, - }) - kb.imap('<S-Tab>', 'v:lua.s_tab_complete()', { - expr = true, - }) - kb.smap('<S-Tab>', 'v:lua.s_tab_complete()', { - expr = true, - }) + kb.inoremap('<cr>', 'compe#confirm("<cr>")', {silent = true, expr = true}) + kb.inoremap('<c-e>', 'compe#close("<c-e>")', {silent = true, expr = true}) + kb.imap('<Tab>', 'v:lua.tab_complete()', {expr = true}) + kb.smap('<Tab>', 'v:lua.tab_complete()', {expr = true}) + kb.imap('<S-Tab>', 'v:lua.s_tab_complete()', {expr = true}) + kb.smap('<S-Tab>', 'v:lua.s_tab_complete()', {expr = true}) end, } - use { - disable = false, - 'tamago324/compe-zsh', - requires = {'hrsh7th/nvim-compe', 'nvim-lua/plenary.nvim'}, - } + use {disable = false, 'tamago324/compe-zsh', requires = {'hrsh7th/nvim-compe', 'nvim-lua/plenary.nvim'}} use { disable = true, 'ms-jpq/coq_nvim', branch = 'coq', - config = function() - vim.g.coq_settings = { - ['display.pum.source_context'] = {'', ''}, - } - end, + config = function() vim.g.coq_settings = {['display.pum.source_context'] = {'', ''}} end, } -- ui @@ -458,10 +330,7 @@ local function init() -- lsp use 'neovim/nvim-lspconfig' - use { - disable = true, - 'RRethy/vim-illuminate', - } + use {disable = true, 'RRethy/vim-illuminate'} use 'ray-x/lsp_signature.nvim' use 'alexaandru/nvim-lspupdate' use { @@ -469,10 +338,7 @@ local function init() requires = 'kyazdani42/nvim-web-devicons', config = function() require('trouble').setup {} end, } - use { - 'folke/lua-dev.nvim', - config = function() end, - } + use {'folke/lua-dev.nvim', config = function() end} use { 'jose-elias-alvarez/null-ls.nvim', config = function() @@ -485,10 +351,7 @@ local function init() -- use 'mfussenegger/nvim-jdtls' -- dap - use { - 'mfussenegger/nvim-dap', - config = function() require('tms.p.dap').setup() end, - } + use {'mfussenegger/nvim-dap', config = function() require('tms.p.dap').setup() end} use { 'rcarriga/nvim-dap-ui', requires = 'mfussenegger/nvim-dap', @@ -504,10 +367,7 @@ local function init() end, requires = {'jbyuki/one-small-step-for-vimkind', 'mfussenegger/nvim-dap'}, } - use { - 'theHamsta/nvim-dap-virtual-text', - requires = {'mfussenegger/nvim-dap'}, - } + use {'theHamsta/nvim-dap-virtual-text', requires = {'mfussenegger/nvim-dap'}} -- treesitter use { @@ -572,10 +432,7 @@ local function init() kb.nnoremap('<space>P', telescope.plugins) end, } - use { - 'nvim-telescope/telescope-packer.nvim', - after = {'telescope.nvim'}, - } + use {'nvim-telescope/telescope-packer.nvim', after = {'telescope.nvim'}} use { 'nvim-telescope/telescope-fzy-native.nvim', after = {'telescope.nvim'},