mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 18:09:06 +02:00
Added new neovim config: WIP
This commit is contained in:
parent
c1e4547e47
commit
88e3a5c360
7 changed files with 371 additions and 480 deletions
76
home-manager-modules/neovim/settings.lua
Normal file
76
home-manager-modules/neovim/settings.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
local keyset = vim.keymap.set
|
||||
|
||||
opt.backup = false
|
||||
opt.writebackup = false
|
||||
opt.updatetime = 300
|
||||
opt.signcolumn = "yes"
|
||||
|
||||
function _G.check_back_space()
|
||||
local col = vim.fn.col('.') - 1
|
||||
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s')
|
||||
end
|
||||
|
||||
local opts = {silent = true, noremap = true, expr = true}
|
||||
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
|
||||
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
|
||||
keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
|
||||
|
||||
|
||||
keyset("n", "gd", "<Plug>(coc-definition)", {silent = true})
|
||||
keyset("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
|
||||
keyset("n", "gi", "<Plug>(coc-implementation)", {silent = true})
|
||||
keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
|
||||
|
||||
function _G.show_docs()
|
||||
local cw = vim.fn.expand('<cword>')
|
||||
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
|
||||
vim.api.nvim_command('h ' .. cw)
|
||||
elseif vim.api.nvim_eval('coc#rpc#ready()') then
|
||||
vim.fn.CocActionAsync('doHover')
|
||||
else
|
||||
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
|
||||
end
|
||||
end
|
||||
keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
|
||||
|
||||
|
||||
|
||||
vim.cmd [[
|
||||
syntax on
|
||||
set scrolloff=4
|
||||
set nocompatible
|
||||
set encoding=utf-8
|
||||
set fileencoding=utf-8
|
||||
|
||||
set smartindent
|
||||
set autoindent
|
||||
set number
|
||||
set relativenumber
|
||||
|
||||
colorscheme onedarker
|
||||
]]
|
||||
|
||||
|
||||
require("nvim-tree").setup()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', 'ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', 'fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', 'fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', 'fh', builtin.help_tags, {})
|
||||
|
||||
require'nvim-web-devicons'.setup()
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
require("bufferline").setup{}
|
||||
|
||||
require('colorizer').setup()
|
||||
|
||||
-- Treesitter settings
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = "", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue