neovim-config/lua/user/settings.lua

101 lines
2.4 KiB
Lua
Raw Normal View History

2022-10-06 04:44:41 +00:00
-- Nubmer column
vim.opt.relativenumber = true
vim.opt.number = true
vim.opt.signcolumn = 'yes' -- remove jitter
-- Wrapping / indenting
vim.opt.wrap = true
vim.opt.breakindent = true
vim.opt.tabstop = 2
vim.opt.softtabstop=2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.smarttab = true
vim.opt.textwidth = 120
vim.opt.colorcolumn = '+1'
-- Search
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.incsearch = true
vim.opt.hlsearch = true
-- Scrolling
vim.opt.scrolloff = 3
vim.opt.sidescrolloff = 15
vim.opt.sidescroll = 1
-- Mouse
vim.opt.mouse = 'a'
-- Window decorations
vim.opt.title = true
2023-12-01 20:26:00 +00:00
vim.opt.titlestring="%{substitute(getcwd(),$HOME,'~','')} - Neovide"
2022-10-06 04:44:41 +00:00
-- Leader
vim.g.mapleader = ' '
-- Fonts
vim.opt.guifont = 'Hack:h9.3'
-- Swap / backup / undo
vim.opt.undofile = true
-- Shell (may speed up nvim)
vim.opt.shell = '/bin/bash'
-- Rendering
vim.opt.lazyredraw = true
-- Folding
vim.opt.foldmethod = 'expr'
vim.opt.foldexpr = vim.call('nvim_treesitter#foldexpr')
-- Completion settings
-- " Set completeopt to have a better completion experience
-- " :help completeopt
-- " menuone: popup even 'hen there's only one match
-- " noinsert: Do not insert text until a selection is made
-- " noselect: Do not select, force user to select one from the menu
vim.opt.completeopt = 'menuone,noinsert,noselect'
-- Avoid showing extra messages when using completion
vim.o.shortmess = vim.o.shortmess .. 'c'
-- Python
2023-12-01 20:26:00 +00:00
vim.g.python3_host_prog = vim.fn.has('macunix') and '/opt/homebrew/bin/python3' or '/usr/bin/python3'
2022-10-06 04:44:41 +00:00
2023-12-01 20:26:00 +00:00
--Shell
vim.opt.shell = 'fish'
2022-10-06 04:44:41 +00:00
-- Format options
vim.cmd([[set formatoptions+=wantrqlc]])
2023-12-01 20:26:00 +00:00
-- Neovide settings
vim.g.neovide_scroll_animation_length = 0.3 -- default: 0.3
vim.g.neovide_cursor_animation_length = 0.06
vim.g.neovide_cursor_trail_size = 0.2 -- default: 0.8
2023-12-01 20:26:00 +00:00
vim.api.nvim_set_hl(0, 'OctoEditable', { bg = '#313131' })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
2023-12-01 20:26:00 +00:00
vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
command = 'set filetype=ruby',
pattern = {'Podfile', 'Fastfile', 'Matchfile', 'Pluginfile', 'Appfile', 'Deliverfile'},
})
2023-12-01 20:26:00 +00:00
vim.opt.fillchars:append { diff = "" }
2023-12-01 20:26:00 +00:00
vim.api.nvim_command([[colorscheme gruvbox]])