diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index aeb96b3..422b8b6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,6 +1,10 @@ vim.o.go = 'a' vim.o.showmode = false +-- disable netrw +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + -- enable mouse for all modes vim.o.mouse = 'a' vim.o.clipboard = 'unnamedplus' @@ -61,6 +65,11 @@ vim.o.undodir = vim.env.XDG_CACHE_HOME .. "/vim/undo" vim.g.python_host_prog = '/usr/bin/python2' vim.g.python3_host_prog = '/usr/bin/python3' +-- append +vim.opt.list = true +vim.opt.listchars:append "space:·" +vim.opt.listchars:append "eol:" + -- set filetypes correctly by extension require('autocmd') diff --git a/.config/nvim/lua/autocmd.lua b/.config/nvim/lua/autocmd.lua index 7d0a4fc..f1174ea 100644 --- a/.config/nvim/lua/autocmd.lua +++ b/.config/nvim/lua/autocmd.lua @@ -16,13 +16,6 @@ vim.filetype.add({ } }) --- delete trailing whitespaces on save -vim.api.nvim_create_autocmd({ 'BufWritePre' }, - { - pattern = { '*' }, - command = [[%s/\s\+$//e]], - }) - -- settings for filetype: c vim.api.nvim_create_autocmd({ 'VimLeave' }, diff --git a/.config/nvim/lua/keymap.lua b/.config/nvim/lua/keymap.lua index c1504eb..1c1d467 100644 --- a/.config/nvim/lua/keymap.lua +++ b/.config/nvim/lua/keymap.lua @@ -5,7 +5,6 @@ vim.g.mapleader = "," -- unmap unwanted commands vim.api.nvim_set_keymap('n', '', '', { noremap = true }) -vim.api.nvim_set_keymap('n', '', '', { noremap = true }) vim.api.nvim_set_keymap('n', '', '', { noremap = true }) vim.api.nvim_set_keymap('n', '', '', { noremap = true }) vim.api.nvim_set_keymap('n', '', '', { noremap = true }) @@ -59,8 +58,8 @@ vim.api.nvim_create_autocmd('FileType', { -- SmiteshP/nvim-navbuddy vim.api.nvim_set_keymap('n', '', ':Navbuddy', {}) --- nvim-neo-tree/neo-tree.nvim -vim.api.nvim_set_keymap('n', '', ':Neotree toggle', {}) +-- nvim-tree/nvim-tree.lua +vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle toggle', {}) -- tpope/vim-fugitive vim.api.nvim_set_keymap('n', 'ga', ':Git add %:p', { noremap = true }) @@ -80,3 +79,6 @@ vim.api.nvim_set_keymap('n', 'gr', ':lua vim.lsp.buf.references()', { norema vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()', { noremap = true }) vim.api.nvim_set_keymap('n', '', ':lua vim.lsp.buf.rename()', { noremap = true }) vim.api.nvim_set_keymap('n', '', ':lua vim.lsp.buf.format()', { noremap = true }) + +-- nvim-telescope/telescope.nvim +vim.api.nvim_set_keymap('n', '', ':Telescope find_files', { noremap = true }) diff --git a/.config/nvim/lua/loadplugins.lua b/.config/nvim/lua/loadplugins.lua index 33f06bc..de5816d 100644 --- a/.config/nvim/lua/loadplugins.lua +++ b/.config/nvim/lua/loadplugins.lua @@ -22,15 +22,17 @@ return require("packer").startup(function(use) -- indicate git diff status of line use { 'lewis6991/gitsigns.nvim' } + -- show indentation lines (in empty lines too) + use { 'lukas-reineke/indent-blankline.nvim' } + -- improved java syntax highlighting use { 'uiiaoo/java-syntax.vim', - ft = { 'java' } } + ft = { 'java' } + } -- custom statusline - use { - 'nvim-lualine/lualine.nvim', - requires = { 'nvim-tree/nvim-web-devicons', - opt = true } + use { 'nvim-lualine/lualine.nvim', + requires = { 'nvim-tree/nvim-web-devicons' } } -- show signature while typing @@ -39,26 +41,18 @@ return require("packer").startup(function(use) -- preview for markdown filetypes use { "iamcco/markdown-preview.nvim", ft = { 'md' }, - run = "cd app && npm install" } + run = "cd app && npm install" + } -- latex asynchronous pdf rendering use { 'donRaphaco/neotex', - ft = { 'tex' } } - - -- fileexplorer on the side - use { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - requires = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - } + ft = { 'tex' } } -- nim language support use { 'zah/nim.vim', - ft = { 'nim' } } + ft = { 'nim' } + } -- automatic closing of brackets use { 'windwp/nvim-autopairs' } @@ -79,14 +73,15 @@ return require("packer").startup(function(use) 'jose-elias-alvarez/null-ls.nvim', 'LostNeophyte/null-ls-embedded', 'nvim-lua/plenary.nvim', - 'jay-babu/mason-null-ls.nvim' } } + 'jay-babu/mason-null-ls.nvim' + } + } -- showing color of hex values, etc use { 'norcalli/nvim-colorizer.lua' } -- show tags - use { - "SmiteshP/nvim-navbuddy", + use { "SmiteshP/nvim-navbuddy", requires = { "neovim/nvim-lspconfig", "SmiteshP/nvim-navic", @@ -94,31 +89,52 @@ return require("packer").startup(function(use) } } + -- fileexplorer on the side + use { "nvim-tree/nvim-tree.lua", + requires = { + "nvim-tree/nvim-web-devicons", + } + } + -- better language highlighting by improved parsing use { 'nvim-treesitter/nvim-treesitter' } -- automatically close html-tags use { 'windwp/nvim-ts-autotag', - requires = { 'nvim-treesitter/nvim-treesitter' } } + requires = { 'nvim-treesitter/nvim-treesitter' } + } -- colorful brackets use { 'luochen1990/rainbow' } + -- fuzzy finder + use { + 'nvim-telescope/telescope.nvim', + tag = '0.1.2', + requires = { 'nvim-lua/plenary.nvim' } + } + + -- clean up white spaces and empty lines before writing + use { "mcauley-penney/tidy.nvim" } + -- todo symbols and highlighting use { 'folke/todo-comments.nvim', - requires = { 'nvim-lua/plenary.nvim' } } + requires = { 'nvim-lua/plenary.nvim' } + } -- git wrapper use { 'tpope/vim-fugitive' } -- golang language support use { 'fatih/vim-go', - ft = { 'go' } } + ft = { 'go' } + } -- markdown language support use { 'preservim/vim-markdown', ft = { 'md' }, - requires = { 'godlygeek/tabular' } } + requires = { 'godlygeek/tabular' } + } -- bulk renamer use { 'qpkorr/vim-renamer' } diff --git a/.config/nvim/plugin/indent-blankline.lua b/.config/nvim/plugin/indent-blankline.lua new file mode 100644 index 0000000..1b9afa3 --- /dev/null +++ b/.config/nvim/plugin/indent-blankline.lua @@ -0,0 +1,6 @@ +-- lukas-reineke/indent-blankline.nvim + +require("indent_blankline").setup { + show_current_context = true, + show_current_context_start = true, +} diff --git a/.config/nvim/plugin/nvim-tree.lua b/.config/nvim/plugin/nvim-tree.lua new file mode 100644 index 0000000..c792c35 --- /dev/null +++ b/.config/nvim/plugin/nvim-tree.lua @@ -0,0 +1,14 @@ +-- nvim-tree/nvim-tree.lua + +require("nvim-tree").setup({ + sort_by = "case_sensitive", + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, +}) diff --git a/.config/nvim/plugin/telescope.lua b/.config/nvim/plugin/telescope.lua new file mode 100644 index 0000000..b86e5c1 --- /dev/null +++ b/.config/nvim/plugin/telescope.lua @@ -0,0 +1,17 @@ +require("telescope").setup { + extensions = { + file_browser = { + theme = "ivy", + -- disables netrw and use telescope-file-browser in its place + hijack_netrw = true, + mappings = { + ["i"] = { + -- your custom insert mode mappings + }, + ["n"] = { + -- your custom normal mode mappings + }, + }, + }, + }, +}