-- vim.bo.modeline = false --disable modeline vim.wo.number = false --??? vim.wo.wrap = true --enable *visual* auto-wrapping vim.opt.autoindent = false --copy indent from current line when starting a new one vim.opt.wildmode = 'longest,list,full' vim.opt.smartindent = true --do smart autoindenting when starting a new line vim.opt.hlsearch = true --highlight search vim.opt.incsearch = true --incremental search vim.opt.ignorecase = true --ignore case for search vim.opt.smartcase = true --consider case if search pattern contains uppercase vim.opt.laststatus = 0 --last window will have a status line: 0: never vim.opt.ruler = true --show "line, column number" of cursor position vim.opt.termguicolors = true --enables 24-bit RGB color in the |TUI| vim.opt.cursorline = false --highlight the text line of the cursor vim.opt.cursorcolumn = false --highlight the screen column of the cursor vim.opt.shortmess = 'atF' --helps to avoid |hit-enter| prompts vim.opt.encoding = 'utf-8' vim.opt.path:append('~/.config/nvim/lua/') vim.opt.suffixesadd = '.lua' --used when searching for a file w/ gf [I etc vim.opt.fileencoding = 'utf-8' vim.opt.expandtab = true --replace Tab with spaces vim.opt.tabstop = 2 --replace Tab with spaces vim.opt.shiftwidth = 2 --replace Tab with spaces vim.opt.splitbelow = true --default split behavior for new windows vim.opt.splitright = true --default split behavior vim.opt.spellfile = os.getenv("HOME") .. '/.dictwords.utf-8.add' --added words vim.opt.list = false --show tabs as pale > vim.opt.listchars = 'space:*,tab:->\\' vim.opt.autoread = true -- auto reload file when changed from outside vim.opt.textwidth = 0 vim.wo.colorcolumn = '0' -- vim.g.langtool_jar='/tmp/LanguageTool-6.3/languagetool-commandline.jar' -- local cmp = require('cmp') cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) -- For `luasnip` users. end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'fuzzy_buffer' }, --{ name = 'look' }, --words in a dictionary slow { name = 'cmp_ctags' }, { name = 'luasnip' }, }, { { name = 'buffer' }, }) }) cmp.setup.cmdline('/', { sources = cmp.config.sources({ { name = 'fuzzy_buffer' } }) }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) -- require("nord").setup({ transparent = true, --disable setting the background color terminal_colors = true, --colors for :terminal in Neovim diff = { mode = "bg" }, --color backgrounds in diff mode [bg|fg] borders = true --visible border between verticaly split windows }) vim.cmd.colorscheme("nord") --vim.cmd('colorscheme blue') --no --vim.cmd('colorscheme darkblue') --no --vim.cmd('colorscheme elflord') --no --vim.cmd('colorscheme evening') --no --vim.cmd('colorscheme industry') --no --vim.cmd('colorscheme murphy') --no --vim.cmd('colorscheme pablo') --no --vim.cmd('colorscheme peachpuff') --pink --vim.cmd('colorscheme ron') --aqua everywhere --vim.cmd('colorscheme torte') --no --vim.cmd('colorscheme zellner') --white bright --vim.cmd('colorscheme slate') --pragmatic bright --vim.cmd('colorscheme shine') --retarded bright --vim.cmd('colorscheme delek') --retarded bright --vim.cmd('colorscheme morning') --slightly less retarded bright --vim.cmd('colorscheme koehler') --norm --vim.cmd('colorscheme desert') --norm -- vim.api.nvim_create_autocmd('BufRead', { --restore last cursor position callback = function(opts) vim.api.nvim_create_autocmd('BufWinEnter', { once = true, buffer = opts.buf, callback = function() local ft = vim.bo[opts.buf].filetype local last_known_line = vim.api.nvim_buf_get_mark(opts.buf, '"')[1] if not (ft:match 'commit' and ft:match 'rebase') and last_known_line > 1 and last_known_line <= vim.api.nvim_buf_line_count(opts.buf) then vim.api.nvim_feedkeys([[g`"]], 'nx', false) end end, }) end, }) local group = vim.api.nvim_create_augroup("filetypedetect", { clear = true }) vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, { group = group, pattern = {"*mutt-*"}, callback = function () vim.cmd("setfiletype mail") end }) vim.api.nvim_create_autocmd({"TermEnter"}, { callback = function () vim.opt.scrolloff = 0 vim.opt.spell = false end }) vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { pattern = {"*.md", "*.txt"}, callback = function () vim.opt.scrolloff = 999 -- vim.opt.textwidth = 0 vim.opt.spell = true vim.opt.spelllang = 'en_us' --]s to jump to next spelling error (incl. regional) --]S to jump to next spelling error (not incl. regional) --z= on incorrect word for suggestions --zg to add to dictionary end }) local unlim_line_length = function() vim.opt.formatoptions:remove('t') vim.wo.colorcolumn = '' end vim.api.nvim_create_autocmd({'BufNewFile','BufRead'}, { pattern = {'*sfeedrc*','/tmp/qmv*','/tmp/calcurse-note*','/tmp/dl.sh'}, callback = unlim_line_length, }) vim.api.nvim_create_autocmd('BufRead', { pattern = '*.bbcode', callback = function() vim.opt.filetype = 'bbcode' end, }) -- vim.api.nvim_create_autocmd('BufRead', { -- pattern = '/tmp/calcurse*', -- callback = function() vim.opt.filetype = 'markdown' end, -- }) vim.api.nvim_create_autocmd({'BufNewFile','BufRead'}, { pattern = '/tmp/crontab.*', callback = function() vim.wo.colorcolumn = '' end, }) vim.api.nvim_create_autocmd('BufWritePre', { --auto del trail whitespace pattern = '*', command = ':%s/\\s\\+$//e', }) vim.api.nvim_create_autocmd('BufRead', { pattern = '*.c', command = '1;/{', }) -- vim.keymap.set('n', '', '') --disable arrow keys vim.keymap.set('n', '', '') --disable arrow keys vim.keymap.set('n', '', '') --disable arrow keys vim.keymap.set('n', '', '') --disable arrow keys vim.keymap.set('n', 'gf', '') --go to file under cursor vim.keymap.set('v', '<', '', '>gv') --retain selection on indent vim.keymap.set('n', '', ':setlocal spell! spelllang=en_us') vim.keymap.set('n', '', 'k') --buffer navigation vim.keymap.set('n', '', 'j') --buffer navigation vim.keymap.set('n', '', 'l') --buffer navigation vim.keymap.set('n', '', 'h') --buffer navigation -- Cntrl-] to jump to definition vim.keymap.set('n', '', '') --jump back from definition vim.keymap.set('n', 'S', ':%s//g') --search and replace vim.g.mapleader = ';' vim.keymap.set('t', '', '') --make Esc work in terminal vim.keymap.set('n', 'cfi', 'iint ){return 0;}kkf)i') --new int i C function vim.keymap.set('n', 'cfv', 'ivoid ){return;}kkkf)i') --new void i C function vim.keymap.set('n', 'ch', ':e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c,') --switch between .h and .c files vim.keymap.set('v', 'y', '"+y') --copy to system clipboard vim.keymap.set('n', 'y', '"+y') --copy to system clipboard vim.keymap.set('n', 'yy', '"+yy') --copy to system clipboard vim.keymap.set('n', 'p', '"+p') --paste from system clipboard vim.keymap.set('n', 'P', '"+P') --paste from system clipboard vim.keymap.set('v', 'p', '"+p') --paste from system clipboard vim.keymap.set('v', 'P', '"+p') --paste from system clipboard vim.keymap.set('n', 'a', ':lua vim.lsp.buf.code_action()') --LSP suggested action -- require('toggleterm').setup({ open_mapping = '', direction = 'horizontal', shade_terminals = true }) -- require('Comment').setup() --gc = comment selection, gcc = comment line require("nvim-surround").setup({ surrounds = { ["S"] = { add = { "" , "" } }, ["C"] = { add = { "" , "" } }, ["J"] = { add = { "" , "" } }, } })