local fn = vim.fn local opt = vim.opt local map = vim.api.nvim_set_keymap 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', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd 'packadd packer.nvim' end require('packer').startup(function() use 'wbthomason/packer.nvim' -- Package Manager use 'nvim-lua/plenary.nvim' -- Lua Library use 'tpope/vim-commentary' -- Commentary use 'nvim-telescope/telescope.nvim' -- Fuzzy Finder use 'tamago324/lir.nvim' -- Filebrowser end) -- General Editor Settings opt.termguicolors = true vim.cmd('colorscheme zenburn') vim.g.mapleader = "," opt.mouse = "nv" opt.pastetoggle = "ZP" opt.number = true opt.relativenumber = true opt.statusline = ' %f %r %m%=%y %{&fileencoding?&fileencoding:&encoding}[%{&fileformat}] %p%% %l:%c ' opt.completeopt = 'menuone,noinsert,noselect' map('n', 'ZT', 'w', { noremap = true }) map('n', 'ZO', '!compiler %', { noremap = true }) map('n', 'ZK', '!kdeconnect-cli -d 3993d52f1018a472 --share %', { noremap = true }) map('n', '/', 'let @/ = ""', { noremap = true }) -- Splits map('n', '', 'h', { noremap = true }) map('n', '', 'j', { noremap = true }) map('n', '', 'k', { noremap = true }) map('n', '', 'l', { noremap = true }) opt.splitbelow = true opt.splitright = true -- Telescope map('n', 'ff', 'lua require("telescope.builtin").find_files()', {noremap = true}) map('n', 'fg', 'lua require("telescope.builtin").live_grep()', {noremap = true}) map('n', 'fb', 'lua require("telescope.builtin").buffers()', {noremap = true}) map('n', 'fh', 'lua require("telescope.builtin").help_tags()', {noremap = true}) -- Lir Filebrowser local actions = require('lir.actions') require('lir').setup { devicons_enable = false, mappings = { ['l'] = actions.edit, [''] = actions.split, [''] = actions.vsplit, [''] = actions.tabedit, ['h'] = actions.up, ['q'] = actions.quit, ['K'] = actions.mkdir, ['N'] = actions.newfile, ['R'] = actions.rename, ['@'] = actions.cd, ['Y'] = actions.yank_path, ['.'] = actions.toggle_show_hidden, ['x'] = actions.delete, }, float = { winblend = 0, win_opts = function() local width = math.floor(vim.o.columns * 0.6) local height = math.floor(vim.o.lines * 0.6) return { width = width, height = height, row = 10, col = math.floor((vim.o.columns - width) / 2), } end, }, hide_cursor = true } map('n', '', 'lua require("lir.float").toggle()', { noremap = true }) vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1