-- LSP -- Map leader to space vim.g.mapleader = ' ' local fn = vim.fn local execute = vim.api.nvim_command -- Sensible defaults require('settings') -- Auto install packer.nvim if not exists local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path) end vim.cmd [[packadd packer.nvim]] vim.cmd 'autocmd BufWritePost plugins.lua PackerCompile' -- Auto compile when there are changes in plugins.lua vim.opt.autoindent = true vim.opt.background = 'light' vim.opt.errorformat:prepend('%f|%l col %c|%m') vim.opt.expandtab = true vim.opt.fileformat = 'unix' vim.opt.number = true vim.opt.pastetoggle = '' vim.opt.shiftwidth = 4 vim.opt.softtabstop = 4 vim.opt.tabstop = 4 vim.opt.textwidth = 125 vim.opt.undofile = true -- Enable vimrc files per project and disable unsafe commands in project vimrc vim.opt.exrc = true vim.opt.secure = true vim.cmd 'noremap :bn' vim.cmd 'noremap :bp' -- Toggles on different plugins/modes vim.cmd 'nmap :set nonumber!' vim.cmd 'nmap :NvimTreeToggle' -- -- Highlight trailing whitespace (darker red) and remove all with Ctrl+k vim.cmd 'highlight WhitespaceEOL ctermbg=red guibg=#ab0d0d' vim.cmd 'match WhitespaceEOL /\\s\\+\\%#\\@ :let _s=@/:%s/\\s\\+$//e:let @/=_s' vim.cmd 'highlight Visual cterm=bold ctermbg=Grey ctermfg=NONE' vim.cmd 'highlight Search ctermfg=Black' vim.cmd 'highlight Comment ctermfg=DarkGrey' vim.cmd 'highlight SignColumn ctermbg=0' vim.cmd 'highlight LineNr ctermbg=0 ctermfg=248' vim.cmd 'highlight Folded ctermbg=Green ctermfg=Black' vim.cmd 'highlight Pmenu ctermbg=253 guibg=253' vim.cmd 'highlight Pmenu ctermfg=232 guifg=232' vim.cmd 'let g:airline_theme=\'papercolor\'' -- Find files using Telescope command-line sugar. vim.cmd 'nnoremap ff Telescope find_files' vim.cmd 'nnoremap fg Telescope live_grep' vim.cmd 'nnoremap fb Telescope buffers' vim.cmd 'nnoremap fh Telescope help_tags' vim.cmd 'nnoremap fl Telescope git_files' -- Install plugins require('plugins') -- Key mappings require('keymappings') -- Setup Lua language server using submodule require('lsp_lua') -- OR you can invoke them individually here --require('colorscheme') -- color scheme require('config.compe') -- completion --require('fugitive') -- fugitive require('lang') require('filetypes')