From 8430fafe74b834b7920c7a5919eac952e487e379 Mon Sep 17 00:00:00 2001 From: Adam <56338480+adastx@users.noreply.github.com> Date: Thu, 14 Oct 2021 15:24:45 +0200 Subject: Nvim full lua setup --- .config/nvim/init.lua | 6 ++++++ .config/nvim/init.vim | 39 --------------------------------------- .config/nvim/lua/init.lua | 5 ----- .config/nvim/lua/opts.lua | 41 ++++++++++++++++++++++++++++++++--------- .config/nvim/lua/plugins.lua | 2 +- .config/nvim/lua/setup.lua | 17 +++++++++++++++++ .config/nvim/lua/stl.lua | 2 +- 7 files changed, 57 insertions(+), 55 deletions(-) create mode 100644 .config/nvim/init.lua delete mode 100644 .config/nvim/init.vim delete mode 100644 .config/nvim/lua/init.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..961f7d2 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,6 @@ +require('plugins') +require('opts') +require('setup') +require('binds') +require('stl') +require('after') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index 426b055..0000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,39 +0,0 @@ -if has('filetype') - filetype indent plugin on -endif - -if has('syntax') - syntax on -endif - -if has('mouse') - set mouse=a -endif - -if has('persistent_undo') - set undodir=$HOME/.vim/undo - set undofile -endif - -lua require 'init' -lua require 'after' - -let g:ascii = [ - \ '', - \ '', - \ ' @@@@@@ @@@@@@@ @@@@@@ @@@@@@@@@@ @@@@@@ @@@ @@@ @@@ ', - \ ' @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @@@@@@@ @@@ @@@ @@@ ', - \ ' @@! @@@ @@! @@@ @@! @@@ @@! @@! @@! !@@ @@! !@@ @@! ', - \ ' !@! @!@ !@! @!@ !@! @!@ !@! !@! !@! !@! !@! @!! !@! ', - \ ' @!@!@!@! @!@ !@! @!@!@!@! @!! !!@ @!@ !!@@!! @!@@!@! !!@ ', - \ ' !!!@!!!! !@! !!! !!!@!!!! !@! ! !@! !!@!!! !!@!!! !!! ', - \ ' !!: !!! !!: !!! !!: !!! !!: !!: !:! !!: :!! !!: ', - \ ' :!: !:! :!: !:! :!: !:! :!: :!: !:! :!: !:! :!: ', - \ ' :: ::: :::: :: :: ::: ::: :: :::: :: :: ::: :: ', - \ ' : : : :: : : : : : : : :: : : : ::: : ', - \ '', - \ '', - \] -let g:startify_custom_header = startify#pad(g:ascii) - -autocmd FileType markdown lua require('cmp').setup.buffer { enabled = false } diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/init.lua deleted file mode 100644 index 3bc3238..0000000 --- a/.config/nvim/lua/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('plugins') -require('opts') -require('setup') -require('binds') -require('stl') diff --git a/.config/nvim/lua/opts.lua b/.config/nvim/lua/opts.lua index 3960c17..8095e24 100644 --- a/.config/nvim/lua/opts.lua +++ b/.config/nvim/lua/opts.lua @@ -54,6 +54,7 @@ cmp.setup { { name = 'ultisnips' }, }, } +vim.cmd('autocmd FileType markdown lua require("cmp").setup.buffer { enabled = false }') -- C# local pid = vim.fn.getpid() @@ -95,17 +96,18 @@ require'lspconfig'.sumneko_lua.setup { }, } -require'lsp_signature'.setup { - hint_enable = false -} - -- HTML, CSS, JS (TS), BASH require'lspconfig'.html.setup{} require'lspconfig'.cssls.setup{} require'lspconfig'.tsserver.setup{} require'lspconfig'.bashls.setup{} --- Treesitter +-- Misc + +require'lsp_signature'.setup { + hint_enable = false, +} + require'nvim-treesitter.configs'.setup { highlight = { enable = true, @@ -122,9 +124,30 @@ require("toggleterm").setup{ close_on_exit = true, -- close the terminal window when the process exits } --- Misc require('kommentary.config').use_extended_mappings() +require('kommentary.config').configure_language("default", { + prefer_single_line_comments = true, +}) vim.o.tabline = '%!v:lua.require\'luatab\'.tabline()' -require("indent_blankline").setup { - buftype_exclude = {"terminal"}, -} + +vim.g.indentLine_bufNameExclude = {'startify', 'NvimTree', 'help', 'toggleterm', 'terminal'} +vim.g.indentLine_bufTypeExclude = {'startify', 'NvimTree', 'help', 'toggleterm', 'terminal'} + +vim.cmd [[ + let g:ascii = [ + \ '', + \ ' @@@@@@ @@@@@@@ @@@@@@ @@@@@@@@@@ @@@@@@ @@@ @@@ @@@ ', + \ ' @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@@@@ @@@@@@@ @@@ @@@ @@@ ', + \ ' @@! @@@ @@! @@@ @@! @@@ @@! @@! @@! !@@ @@! !@@ @@! ', + \ ' !@! @!@ !@! @!@ !@! @!@ !@! !@! !@! !@! !@! @!! !@! ', + \ ' @!@!@!@! @!@ !@! @!@!@!@! @!! !!@ @!@ !!@@!! @!@@!@! !!@ ', + \ ' !!!@!!!! !@! !!! !!!@!!!! !@! ! !@! !!@!!! !!@!!! !!! ', + \ ' !!: !!! !!: !!! !!: !!! !!: !!: !:! !!: :!! !!: ', + \ ' :!: !:! :!: !:! :!: !:! :!: :!: !:! :!: !:! :!: ', + \ ' :: ::: :::: :: :: ::: ::: :: :::: :: :: ::: :: ', + \ ' : : : :: : : : : : : : :: : : : ::: : ', + \ '', + \ '', + \] + let g:startify_custom_header = startify#pad(g:ascii) +]] diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 667ccdb..5ec796c 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -17,7 +17,7 @@ require('packer').startup(function() use 'mhinz/vim-startify' use "akinsho/toggleterm.nvim" use "ray-x/lsp_signature.nvim" - use "lukas-reineke/indent-blankline.nvim" + use "Yggdroot/indentLine" use { 'nvim-telescope/telescope.nvim', diff --git a/.config/nvim/lua/setup.lua b/.config/nvim/lua/setup.lua index 5f9cd4f..5d71554 100644 --- a/.config/nvim/lua/setup.lua +++ b/.config/nvim/lua/setup.lua @@ -1,5 +1,22 @@ local set = vim.opt +if vim.fn.has('mouse') then + set.mouse = "a" +end + +if vim.fn.has('filetype') then + vim.cmd('filetype indent plugin on') +end + +if vim.fn.has('syntax') then + vim.cmd('syntax on') +end + +if vim.fn.has('persistent_undo') then + vim.cmd('set undodir=$HOME/.vim/undo') + vim.cmd('set undofile') +end + set.termguicolors = true set.hidden = true set.wildmenu = true diff --git a/.config/nvim/lua/stl.lua b/.config/nvim/lua/stl.lua index f751506..633dcaa 100644 --- a/.config/nvim/lua/stl.lua +++ b/.config/nvim/lua/stl.lua @@ -4,7 +4,7 @@ require'lualine'.setup { theme = 'gruvbox', component_separators = {'', ''}, section_separators = {'', ''}, - disabled_filetypes = {'startify', 'NvimTree', 'toggleterm'} + disabled_filetypes = {'startify', 'NvimTree', 'toggleterm', 'terminal'} }, sections = { lualine_a = {'mode'}, -- cgit v1.2.3-70-g09d2