312 lines
8.3 KiB
VimL
312 lines
8.3 KiB
VimL
set nocompatible " disable compatibility to old-time vi
|
|
set showmatch " show matching
|
|
set mouse=v " middle-click paste with
|
|
set hlsearch " highlight search
|
|
set incsearch " incremental search
|
|
set tabstop=16 " number of columns occupied by a tab
|
|
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
|
|
set shiftwidth=4 " width for autoindents
|
|
set autoindent " indent a new line the same amount as the line just typed
|
|
set number relativenumber " add line numbers
|
|
set wildmode=longest,list " get bash-like tab completions
|
|
set cc=80 " set an 80 column border for good coding style
|
|
|
|
|
|
filetype off
|
|
let &runtimepath.=',~/.vim/bundle/neoterm'
|
|
filetype plugin on
|
|
filetype plugin indent on "allow auto-indenting depending on file type
|
|
syntax on " syntax highlighting
|
|
|
|
|
|
set mouse=a " enable mouse click
|
|
set clipboard=unnamedplus " using system clipboard
|
|
set ttyfast " Speed up scrolling in Vim
|
|
set cursorline " highlight current cursorline
|
|
set splitbelow
|
|
|
|
set undofile
|
|
set autochdir
|
|
|
|
set signcolumn=yes:1
|
|
|
|
|
|
" PLUGINS
|
|
|
|
|
|
call plug#begin()
|
|
|
|
Plug 'navarasu/onedark.nvim'
|
|
Plug 'echasnovski/mini.nvim'
|
|
Plug 'nvim-tree/nvim-web-devicons'
|
|
Plug 'NvChad/nvim-colorizer.lua'
|
|
Plug 'kassio/neoterm'
|
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
|
Plug 'folke/noice.nvim'
|
|
Plug 'MunifTanjim/nui.nvim'
|
|
Plug 'SirVer/ultisnips'
|
|
Plug 'lervag/vimtex'
|
|
Plug 'williamboman/mason.nvim', { 'do': ':MasonUpdate' }
|
|
|
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
Plug 'hrsh7th/cmp-buffer'
|
|
Plug 'hrsh7th/cmp-path'
|
|
Plug 'hrsh7th/cmp-cmdline'
|
|
Plug 'hrsh7th/nvim-cmp'
|
|
|
|
Plug 'SirVer/ultisnips'
|
|
Plug 'quangnguyen30192/cmp-nvim-ultisnips'
|
|
|
|
Plug 'bkad/camelcasemotion'
|
|
|
|
|
|
Plug 'nvim-neorg/neorg'
|
|
Plug 'nvim-lua/plenary.nvim'
|
|
Plug 'tpope/vim-commentary'
|
|
|
|
|
|
Plug 'ggandor/lightspeed.nvim'
|
|
Plug 'gen740/SmoothCursor.nvim'
|
|
|
|
|
|
Plug 'folke/twilight.nvim'
|
|
Plug 'folke/zen-mode.nvim'
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
|
|
|
|
" ULTISNIPS
|
|
|
|
let g:UltiSnipsExpandTrigger="<tab>"
|
|
let g:UltiSnipsJumpForwardTrigger="jk"
|
|
let g:UltiSnipsJumpBackwardTrigger="kj"
|
|
|
|
let g:UltiSnipsSnippetDirectories = [$HOME.'/.config/nvim/UltiSnips']
|
|
let g:UltiSnipsEditSplit = 'context'
|
|
|
|
|
|
|
|
|
|
|
|
" COLORSCHEME
|
|
|
|
set termguicolors
|
|
set background=dark
|
|
|
|
let g:onedark_config = {
|
|
\ 'style': 'darker',
|
|
\}
|
|
colorscheme onedark
|
|
|
|
|
|
|
|
|
|
|
|
" KEYMAPS
|
|
|
|
let mapleader=" "
|
|
|
|
nnoremap <leader>tw <cmd>lua MiniTrailspace.trim()<CR>
|
|
nnoremap <leader>ff <cmd>lua MiniFiles.open()<CR>
|
|
nnoremap <leader>fc <cmd>lua MiniFiles.close()<CR>
|
|
nnoremap <leader>tt <cmd>12 split <CR><cmd>Tnew<CR>
|
|
nnoremap <leader>sc <cmd>TSEnable highlight<CR>
|
|
|
|
nnoremap <leader>zt <cmd>Twilight<CR>
|
|
nnoremap <leader>zz <cmd>ZenMode<CR>
|
|
|
|
|
|
nnoremap <leader>v :vsplit ~/.config/nvim/init.vim<CR>
|
|
nnoremap <leader>V :source ~/.config/nvim/init.vim<CR>
|
|
|
|
nnoremap <leader>s :UltiSnipsEdit<CR>
|
|
nnoremap <leader>S :call UltiSnips#RefreshSnippets() <CR>
|
|
|
|
map <silent> w <Plug>CamelCaseMotion_w
|
|
map <silent> b <Plug>CamelCaseMotion_b
|
|
map <silent> e <Plug>CamelCaseMotion_e
|
|
map <silent> ge <Plug>CamelCaseMotion_ge
|
|
sunmap w
|
|
sunmap b
|
|
sunmap e
|
|
sunmap ge
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" LUA SHIT
|
|
|
|
|
|
lua << EOF
|
|
|
|
require('colorizer').setup()
|
|
require('mini.completion').setup()
|
|
require('mini.cursorword').setup()
|
|
require('mini.files').setup()
|
|
require('mini.pairs').setup()
|
|
require('mini.starter').setup()
|
|
require('mini.trailspace').setup()
|
|
require('mini.statusline').setup()
|
|
require('mini.trailspace').setup()
|
|
require('mini.hipatterns').setup()
|
|
require('mini.indentscope').setup()
|
|
require('noice').setup()
|
|
require("mason").setup()
|
|
require('smoothcursor').setup()
|
|
|
|
|
|
|
|
|
|
-- Neorg SETUP
|
|
|
|
|
|
require('neorg').setup {
|
|
load = {
|
|
["core.defaults"] = {}, -- Loads default behaviour
|
|
["core.concealer"] = {}, -- Adds pretty icons to your documents
|
|
["core.dirman"] = { -- Manages Neorg workspaces
|
|
config = {
|
|
workspaces = {
|
|
notes = "~/notes",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- CMP SETUP
|
|
|
|
|
|
|
|
-- Set up nvim-cmp.
|
|
local cmp = require'cmp'
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
-- REQUIRED - you must specify a snippet engine
|
|
expand = function(args)
|
|
--vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
|
vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
end,
|
|
},
|
|
window = {
|
|
-- completion = cmp.config.window.bordered(),
|
|
-- documentation = cmp.config.window.bordered(),
|
|
},
|
|
mapping = cmp.mapping.preset.insert({
|
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
['<C-Space>'] = cmp.mapping.complete(),
|
|
['<C-e>'] = cmp.mapping.abort(),
|
|
['<CR>'] = 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 = 'vsnip' }, -- For vsnip users.
|
|
-- { name = 'luasnip' }, -- For luasnip users.
|
|
{ name = 'ultisnips' }, -- For ultisnips users.
|
|
-- { name = 'snippy' }, -- For snippy users.
|
|
}, {
|
|
{ name = 'buffer' },
|
|
})
|
|
})
|
|
|
|
-- Set configuration for specific filetype.
|
|
cmp.setup.filetype('gitcommit', {
|
|
sources = cmp.config.sources({
|
|
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
|
}, {
|
|
{ name = 'buffer' },
|
|
})
|
|
})
|
|
|
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
|
cmp.setup.cmdline({ '/', '?' }, {
|
|
mapping = cmp.mapping.preset.cmdline(),
|
|
sources = {
|
|
{ name = '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' }
|
|
})
|
|
})
|
|
|
|
-- Set up lspconfig.
|
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
|
require('lspconfig')['clangd'].setup {
|
|
capabilities = capabilities
|
|
}
|
|
require('lspconfig')['texlab'].setup {
|
|
capabilities = capabilities
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('smoothcursor').setup({
|
|
autostart = true,
|
|
cursor = "", -- cursor shape (need nerd font)
|
|
texthl = "SmoothCursor", -- highlight group, default is { bg = nil, fg = "#FFD400" }
|
|
linehl = nil, -- highlight sub-cursor line like 'cursorline', "CursorLine" recommended
|
|
type = "default", -- define cursor movement calculate function, "default" or "exp" (exponential).
|
|
fancy = {
|
|
enable = true, -- enable fancy mode
|
|
head = { cursor = "▷", texthl = "SmoothCursor", linehl = nil },
|
|
body = {
|
|
{ cursor = "", texthl = "SmoothCursorYellow" },
|
|
{ cursor = "", texthl = "SmoothCursorYellow" },
|
|
{ cursor = "●", texthl = "SmoothCursorYellow" },
|
|
{ cursor = "●", texthl = "SmoothCursorYellow" },
|
|
{ cursor = "•", texthl = "SmoothCursorYellow" },
|
|
{ cursor = ".", texthl = "SmoothCursorYellow" },
|
|
{ cursor = ".", texthl = "SmoothCursorYellow" },
|
|
},
|
|
tail = { cursor = nil, texthl = "SmoothCursor" }
|
|
},
|
|
flyin_effect = nil, -- "bottom" or "top"
|
|
speed = 75, -- max is 100 to stick to your current position
|
|
intervals = 25, -- tick interval
|
|
priority = 10, -- set marker priority
|
|
timeout = 1500, -- timout for animation
|
|
threshold = 3, -- animate if threshold lines jump
|
|
disable_float_win = false, -- disable on float window
|
|
enabled_filetypes = nil, -- example: { "lua", "vim" }
|
|
disabled_filetypes = nil, -- this option will be skipped if enabled_filetypes is set. example: { "TelescopePrompt", "NvimTree" }
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
EOF
|