diff --git a/.gitignore b/.gitignore index 47ad858..c9d442c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ plugin/* +spell/* diff --git a/README.md b/README.md index cd2f55d..df3bbab 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,131 @@ # nvim +![screenshot](./screenshot.png) + ## Notes Neovim must be above **0.5** to work well with lua config, and some plugin need **0.7** version. +## Commands + +### General + +- `+` increase first number in line after the cursor +- `-` decrease first number in line after the cursor +- `o` close other splits +- `w` close buffer +- `q` quit all +- `` Refresh buffer +- `e` refresh buffer +- `` to move into panes + +### Visual + +- `t` to switch dark|light theme +- `g` toggle goyo view mode + +### GitSigns + +- `]c` next hunk +- `[c` next hunk +- `hs` stage hunk +- `hr` reset hunk +- `hu` undo hunk +- `hp` preview hunk +- `hb` preview hunk in popup +- `tb` preview hunk in line +- `hd` diff current file + +### Telescope + +- `f` find file with git +- `fg` find file with grep +- `ft` find file with tag + +### Saga + +- `` & `` to move + +### Completion + +Some lsp server work only inside project folder, +needing *git* or *composer*… + +- `` to choose selected suggestion + +### Lspsaga + +- `gf` show definition +- `gD` got to declaration +- `gd` see definition +- `gi` go to implementation +- `ca` see available code actions +- `rn` smart rename +- `D` show diagnostics +- `[d` go to next dianostic +- `]d` go to previous dianostic +- `K` show documentation +- `s` show structure +- `f` format current buffer + +#### Typescript specific + +- `rf` rename file & update imports +- `oi` organize imports +- `ru` remove unused variables + +#### Ruby On Rails specific + +- `:A` alternate between file & test +- `:R` jump to related controller->view +- `:Emodel` jump to related model +- `:Smodel` same but in split +- `:Vmodel` same but in vsplit +- `:Tmodel` same but in tab +- `:Eview` jump to related view +- `:Sview` same but in split +- `:Vview` same but in vsplit +- `:Tview` same but in tab +- `:Econtroller` jump to related controller +- `:Scontroller` same but in split +- `:Vcontroller` same but in vsplit +- `:Tcontroller` same but in tab +- `:Emodel foo!` to automatically create the file with the standard boilerplate if it doesn't exist +- `:Rails console` to call `rails console` +- `:Generate controller ControllerName` generate controller and loads the generated files into the quickfix list +- `:Rails` (with no arguments) to run the current test, spec, or feature +- `:.Rails` to do a focused run of just the method, example, or scenario on the current line +- `:Extract {file}` replaces the desired range (typically selected in visual line mode) with render '{file}' + - `help rails-:Extract` +- `:help rails-navigation` + +#### Easy align +- `=` interactively align selection + ## Some resources + - https://teukka.tech/luanvim.html - https://github.com/nanotee/nvim-lua-guide - https://medium.com/linux-with-michael/a-list-of-all-my-main-neovim-plugins-8ac4ae107e16 - https://vonheikemen.github.io/devlog/tools/build-your-first-lua-config-for-neovim/ +- https://github.com/josean-dev/dev-environment-files +- https://marioyepes.com/neovim-ide-with-lua-for-web-development/ ## Satisfying (trying) checkhealth + To check run `:checkhealth` in neovim - Check latest version of `pynvim` is installed (via pip) - Check npm neovim is installed, but still no enough -## Plugin manager: Packer +## Plugins + +### Plugin manager: Packer + ### For the first use + [source](https://github.com/wbthomason/packer.nvim#quickstart) + > To get started, first clone this repository to somewhere on your packpath, e.g.: ```shell git clone --depth 1 https://github.com/wbthomason/packer.nvim\ @@ -29,6 +136,7 @@ git clone --depth 1 https://github.com/wbthomason/packer.nvim\ > `:PackerCompile` ## External dependencies + - `ripgrep` - `fd-find` - `python3` @@ -41,76 +149,3 @@ git clone --depth 1 https://github.com/wbthomason/packer.nvim\ - https://www.nerdfonts.com/ - `composer` - `phpcs` - - `composer global require "squizlabs/php_codesniffer=*"` [source](https://github.com/squizlabs/PHP_CodeSniffer#composer) - -
- What i want - -### Maybe without plug-in -- [ ] find lua version of a vim option -- [ ] nice & robust setting for tags -- [ ] smart indentation on paste from clipboard - - https://github.com/neovim/neovim/issues/3566 - - `]p` - -### With plugin -- [X] a nice completion please - - [ ] Order suggestion: - 1. definition (with tags?) - 2. buffer - 3. clipboard never - - [ ] Documentation on hover -- [ ] snippets - - https://github.com/SirVer/ultisnips - - *just a library of snippets* https://github.com/honza/vim-snippets -- [X] linter (nvim-lint) - - for: - - [ ] php - - `phpcs -e *.php` Explain a standard by showing the sniffs it includes - - `phpcs -e *.php` Explain a standard by showing the sniffs it includes - - `phpcs -i` Show a list of installed coding standards - - [ ] force type hint - - try https://github.com/slevomat/coding-standard - - [ ] force type return - - [ ] force strict - - [ ] javascript - - simple quote - - [ ] react - - [ ] typescript - - [ ] lua - - [ ] nginx - - [ ] docker - - [ ] sql - - [ ] ruby - - [ ] python - - [ ] shell - -### Done -- [X] spell check, FR & EN -- [X] on fresh open file, jump line of the history -- [X] mouse to click & scroll -- [X] max line length highlight -- [X] keep column width for gitsigns -- [X] barbar - - [X] use tab instead classic buffer - - [X] visual order cycling - Using only buffer & no vim tab make it OK, - but have to quit explicitly the last buffer -- [X] switch dark / light theme -- [X] succeed to put plug-in config in a separate file -- [X] pair -- [X] visual search -- [X] Visual status bar -- [X] markdown ? Not easy for code blocks - - Finally no plug-in for markdown, the visual out of the box suit to me. - Just add goyo, having a clear space when I'm not coding -- [X] ~~like ctrlp~~ telescope -- [X] indent setting by language -- [X] jump chunk to chunk -- [X] like vim gutter -- [X] comment quickly -- [X] surround -- [X] compile when needed -- [X] like nerdtree -- [X] map f5 to `:e!` -
diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..d9b0884 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,40 @@ +export default [ + { + rules: { + 'array-bracket-spacing': ['warn', 'never'], + 'brace-style': ['warn', '1tbs', { allowSingleLine: true }], + 'comma-spacing': 'warn', + 'comma-style': ['warn', 'first'], + 'computed-property-spacing': ['warn', 'never'], + 'constructor-super': 'error', + 'function-call-argument-newline': ['warn', 'consistent'], + indent: ['warn', 2], + 'jsx-quotes': ['warn', 'prefer-double'], + 'key-spacing': ['warn', { beforeColon: false, afterColon: true }], + 'max-len': ['warn', { ignoreTrailingComments: true }], + 'newline-before-return': 'warn', + 'newline-per-chained-call': 'warn', + 'no-console': 'warn', + 'no-const-assign': 'error', + 'no-else-return': 'warn', + 'no-empty': 'warn', + 'no-eq-null': 'warn', + 'no-mixed-spaces-and-tabs': 'warn', + 'no-multiple-empty-lines': 'warn', + 'no-tabs': 'warn', + 'no-trailing-spaces': 'warn', + 'no-unneeded-ternary': 'warn', + 'no-useless-return': 'warn', + 'no-warning-comments': 'warn', + 'prefer-destructuring': 'warn', + quotes: ['warn', 'single', { avoidEscape: true }], + 'rest-spread-spacing': ['warn', 'never'], + 'semi-spacing': ['warn', { before: false, after: false }], + 'semi-style': ['warn', 'last'], + }, + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + }, +] diff --git a/eslint.json b/eslint.json deleted file mode 100644 index 22abc7f..0000000 --- a/eslint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "env": { - "es6": true - } -} diff --git a/init.lua b/init.lua index 122d435..447fc3e 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +-- require('impatient') -- FIXME not properly installed + vim.g['python3_host_prog'] = '/usr/bin/python3' require('options') diff --git a/lua/mapping.lua b/lua/mapping.lua index 4c72857..4cba3a9 100644 --- a/lua/mapping.lua +++ b/lua/mapping.lua @@ -1,37 +1,41 @@ +vim.g.mapleader = ',' + local map = vim.api.nvim_set_keymap +local noremap = { noremap = true } + +-- general +map('n', '+', '', noremap) +map('n', '-', '', noremap) + +map('n', 'o', ':on', noremap) +map('n', 'w', ':q', noremap) +map('n', 'q', ':qa', noremap) + +map('n', '', ':e!', noremap) +map('n', 'e', ':Neotree toggle', noremap) +map('n', 'r', ':lua PreviewReadme()', noremap) -noremap = {noremap = true} +-- Goyo +map('n', 'g', ':Goyo ', noremap) -- Telescope -map('n', 'ff', ":Telescope find_files prompt_prefix= 🔍  find_command=rg,--ignore,--hidden,--files ", noremap) -map('n', 'fg', ":Telescope git_files prompt_prefix=  ", noremap) -map('n', 'ft', ":Telescope help_tags prompt_prefix=  ", noremap) - ---[[ tab, barbar - no more vim-tab used, only buffer, have to quit explitly for the last buffer -]] -map('n', 'w', ":BufferDelete", noremap) -map('n', 'q', ":quit", noremap) - --- COC --- Confirm selection with ctr space -vim.cmd([[ - inoremap coc#pum#visible() ? coc#pum#confirm() : "\" -]]) - --- Cycle suggestion with tab ↓ and s-tab ↑ -vim.cmd([[ - inoremap - \ coc#pum#visible() ? coc#pum#next(1) : - \ CheckBackspace() ? "\" : - \ coc#refresh() - inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -]]) - ---[[ FIXME documentation on hover --- > Error on notification "doHover": hover provider not found for current buffer, your language server doesn't support it --- So install server php -]] -vim.cmd([[ - nnoremap h :call CocActionAsync('doHover') -]]) +map('n', 'f', ':Telescope git_files prompt_prefix=  ', noremap) +map('n', 'ff', ':Telescope find_files hidden=true no_ignore=true prompt_prefix=  ', noremap) +map('n', 'fg', ':Telescope live_grep prompt_prefix= 󰈞 ', noremap) +map('n', 'ft', ':Telescope help_tags prompt_prefix=  ', noremap) +map('n', 'fr', ':Telescope resume prompt_prefix=  ', noremap) + +-- Vim-tmux-navigator +map('n', '', ':TmuxNavigateLeft', noremap) +map('n', '', ':TmuxNavigateDown', noremap) +map('n', '', ':TmuxNavigateUp', noremap) +map('n', '', ':TmuxNavigateRight', noremap) + +-- Vim-easy-align +map('v', '=', ':LiveEasyAlign', noremap) + +-- Mardown togglecheck +-- -- toggle checked / create checkbox if it doesn't exist +map('n', '', ":lua require('markdown-togglecheck').toggle()", noremap) +-- -- toggle checkbox (it doesn't remember toggle state and always creates [ ]) +map('n', '', ":lua require('markdown-togglecheck').toggle_box()", noremap) diff --git a/lua/options.lua b/lua/options.lua index e969bf3..628ad39 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,48 +1,110 @@ -vim.g.mapleader = ',' +local opt = vim.opt -- basic settings -vim.o.encoding = 'utf-8' -vim.o.completeopt = 'menuone,noselect' -vim.opt.mouse = 'a' +opt.encoding = 'utf-8' +opt.completeopt = 'menuone,noselect' +opt.mouse = 'a' -- Display -vim.o.backspace = 'indent,eol,start' -- backspace works on every char in insert mode -vim.o.synmaxcol = 300 -- stop syntax highlight after x lines for performance -vim.o.foldmethod = 'syntax' -- use language syntax to generate folds -vim.o.showbreak = '↪' -- character to show when line is broken -vim.o.signcolumn = 'yes' -vim.opt.termguicolors = true +opt.synmaxcol = 300 -- stop syntax highlight after x lines for performance +-- There are six methods to select folds: +-- manual manually define folds +-- indent more indent means a higher fold level +-- expr specify an expression to define folds +-- syntax folds defined by syntax highlighting +-- diff folds for unchanged text +-- marker folds defined by markers in the text +opt.foldmethod = 'manual' -- use language syntax to generate folds +opt.showbreak = '↪' -- character to show when line is broken +opt.signcolumn = 'yes' +opt.termguicolors = true vim.cmd([[ au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]) -vim.o.spelllang = 'en,fr' -vim.o.spell = true +opt.spelllang = 'en,fr' +opt.spell = true -- Sidebar -vim.o.number = true -vim.o.numberwidth = 3 -- always reserve 3 spaces for line number -vim.o.ignorecase = true -- ignore letter case when searching -vim.o.smartcase = true -- case insentive unless capitals used in search +opt.number = true +opt.numberwidth = 3 -- always reserve 3 spaces for line number +-- Search +opt.ignorecase = true -- ignore letter case when searching +opt.smartcase = true -- case insentive unless capitals used in search --- Tabs -vim.o.smartindent = true -vim.o.tabstop = 2 -- 1 tab = 2 spaces -vim.o.shiftwidth = 2 -- indentation rule -vim.o.expandtab = true -- expand tab to spaces +-- Indentation +opt.smartindent = true +opt.tabstop = 2 -- 1 tab = 2 spaces +opt.shiftwidth = 2 -- indentation rule +opt.expandtab = true -- expand tab to spaces +opt.autoindent = true vim.cmd([[ - augroup tab_for_python + augroup tab_for_4_spaces autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab autocmd FileType php setlocal ts=4 sts=4 sw=4 expandtab + autocmd FileType make setlocal ts=4 sts=4 sw=4 expandtab + autocmd FileType yaml setlocal ts=4 sts=4 sw=4 expandtab + augroup end + + augroup vue_indent + autocmd FileType vue setlocal nosmartindent autoindent indentexpr=HtmlIndent() + augroup end + + augroup un_explicit_files + autocmd BufRead,BufNewFile *.js.erb setfiletype javascript.erb + autocmd BufRead,BufNewFile *.css.erb setfiletype css.erb + autocmd BufRead,BufNewFile *.env.* setfiletype sh augroup end ]]) --- Mapping -vim.api.nvim_set_keymap('n', '', ':e!', { noremap = true }) -vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', { noremap = true }) +-- Backspace +opt.backspace = 'indent,eol,start' -- backspace works on every char in insert mode +opt.iskeyword:append('-') +opt.iskeyword:append('$') + +-- Cursor +opt.cursorline = true + +-- Clipboard +opt.clipboard:append('unnamedplus') + +-- Split +opt.splitright = true +opt.splitbelow = true -function toggleThemeLight() - vim.o.background = vim.o.background == 'dark' and 'light' or 'dark' +-- Preview README.md +-- Way found here: https://dev.to/____marcell/how-to-create-an-ui-menu-in-neovim-2k6a +local status = pcall(require, "plenary.popup") +local buffer_id + +function ShowPopup(content, cb) + local height = 20 + local width = 60 + local borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" } + + -- https://github.com/nvim-lua/plenary.nvim/blob/master/lua/plenary/popup/init.lua + buffer_id = popup.create(content, { + title = "My Neovim README", + line = math.floor(((vim.o.lines - height) / 2) - 1), + col = math.floor((vim.o.columns - width) / 2), + maxwidth = width, + maxheight = height, + borderchars = borderchars, + callback = cb, + }) + + local buffer = vim.api.nvim_win_get_buf(buffer_id) + vim.api.nvim_buf_set_keymap(buffer, "n", "q", "lua CloseMenu()", { silent=false }) + vim.api.nvim_command('set ft=markdown') end -vim.api.nvim_set_keymap('n', 't', ':lua toggleThemeLight()', { noremap = true }) +function CloseMenu() + vim.api.nvim_win_close(buffer_id, true) +end + +function PreviewReadme() + local readme_path = "/home/tarik/.config/nvim/README.md" + local content = vim.fn.readfile(readme_path) + + ShowPopup(content) +end diff --git a/lua/plugins.lua b/lua/plugins.lua index 5434c31..3003508 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,123 +1,200 @@ --- Compile each time this file is edited & source it ! +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +-- Compile & sync each time this file is edited & source it ! vim.cmd([[ augroup packer_user_config autocmd! - autocmd BufWritePost plugins.lua source | PackerCompile + autocmd BufWritePost plugins.lua source | PackerSync augroup end ]]) return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - use 'tpope/vim-fugitive' -- Git commands - use 'EdenEast/nightfox.nvim' -- Themes - use { - 'navarasu/onedark.nvim', -- Themes - config = function() require'plugins.onedark' end - } - use { - 'romgrk/barbar.nvim', - requires = {'kyazdani42/nvim-web-devicons'}, - config = function() require'plugins.barbar' end - } - use 'nelstrom/vim-visual-star-search' - use { - 'feline-nvim/feline.nvim', - branch = '0.5-compat', - config = function() require'plugins.feline' end - } - use 'junegunn/goyo.vim' - use { - 'nvim-treesitter/nvim-treesitter', - config = function() require'plugins.treesitter' end - } - use { - 'kyazdani42/nvim-tree.lua', - opt = true, - requires = { - 'kyazdani42/nvim-web-devicons', - }, - cmd = {'NvimTreeToggle', 'NvimTreeFindFile'}, - config = function() require'plugins.tree' end - } - use { - 'nvim-telescope/telescope.nvim', - tag = '0.1.0', - requires = {'nvim-lua/plenary.nvim'}, - config = function() require'plugins.telescope' end - } - use { - 'lukas-reineke/indent-blankline.nvim', - config = function() require'plugins.indent-blankline' end - } - use { - 'kylechui/nvim-surround', - tag = '*', -- Use for stability; omit to use `main` branch for the latest features - config = function() require'nvim-surround'.setup() end - } - use { - 'terrortylor/nvim-comment', - config = function() require'nvim_comment'.setup() end - } - use { - 'windwp/nvim-autopairs', - config = function() require'nvim-autopairs'.setup() end - } - use { - --[[ - You have to install coc extension or configure language servers for LSP support. - Install extensions like: - :CocInstall coc-json coc-tsserver - ]] - 'neoclide/coc.nvim', - branch = 'release', - config = function() require'plugins.coc' end - } - use 'tjdevries/overlength.vim' - use { - 'mfussenegger/nvim-lint', - requires = {'eslint/eslint', 'squizlabs/PHP_CodeSniffer'}, - config = function() require'plugins.nvim-lint' end - } + -- CORE + use 'wbthomason/packer.nvim' -- Plugin manager + -- use 'lewis6991/impatient.nvim' -- Speed up neovim + use{ -- Configuring lsp servers + 'neovim/nvim-lspconfig', + config = function() require'plugins.nvim-lspconfig' end + } + use{ -- Install and manage LSP servers, DAP servers, linters, and formatters + 'williamboman/mason.nvim', + config = function() require'mason'.setup() end + } + use{ -- Bridges mason.nvim with the lspconfig plugin + 'williamboman/mason-lspconfig.nvim', + config = function() require'plugins.mason-lspconfig' end + } + use{ -- Light-weight lsp plugin based on neovim's built-in lsp + 'glepnir/lspsaga.nvim', + branch = 'main', + config = function() require'plugins.lspsaga-nvim' end + } + use "nvim-lua/plenary.nvim" - use { - 'lewis6991/gitsigns.nvim', - config = function() - require('gitsigns').setup { - on_attach = function(bufnr) - local gs = package.loaded.gitsigns + -- SYNTAX + use { -- Provide a way to use the interface for tree-sitter in Neovim + -- and to provide some basic functionality such as highlighting based on it + 'nvim-treesitter/nvim-treesitter', + config = function() require'plugins.treesitter' end + } + use 'fladson/vim-kitty' -- Syntax highlight for kitty configuration + use { -- Indentation guides + 'lukas-reineke/indent-blankline.nvim', + config = function() require('ibl').setup({ + exclude = { + filetypes = { + 'dashboard' + } + } + }) end + } + use { -- Highlight overlength lines + 'lcheylus/overlength.nvim', + config = function() require'plugins.overlength' end + } + use { -- Linters + 'mfussenegger/nvim-lint', + requires = {'eslint/eslint', 'squizlabs/PHP_CodeSniffer'}, + config = function() require'plugins.nvim-lint' end + } + use 'tpope/vim-rails' + use { + 'RRethy/nvim-treesitter-endwise', + config = function() require'nvim-treesitter.configs'.setup { + endwise = { + enable = true, + } + } + end + } - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end + -- EDITING + use { -- Surround selections + 'kylechui/nvim-surround', + tag = '*', -- Use for stability; omit to use `main` branch for the latest features + config = function() require'nvim-surround'.setup({}) end + } + use 'chaoren/vim-wordmotion' -- Smart motion inside words + use { -- Easy comment + 'terrortylor/nvim-comment', + config = function() require'nvim_comment'.setup() end + } + use{ -- Auto complete pairs symbols + 'windwp/nvim-autopairs', + config = function() require'plugins.nvim-autopairs' end + } + use{ -- Autoclose and autorename html tag + 'windwp/nvim-ts-autotag', + config = function() require'plugins.nvim-ts-autotag' end + } + use{ -- Snippet engine + 'L3MON4D3/LuaSnip', + config = function() + require('luasnip.loaders.from_vscode').lazy_load({paths = '~/.config/nvim/my_snippets'}) + end + } + use 'inkarkat/vim-ReplaceWithRegister' -- Replace with register contents using motion (gr + motion) + use 'nelstrom/vim-visual-star-search' -- Search based selection + use 'junegunn/vim-easy-align' + use({ + 'NFrid/markdown-togglecheck', + requires = 'NFrid/treesitter-utils', + config = function() + -- -- toggle checked / create checkbox if it doesn't exist + -- vim.api.nvim_set_keymap('n', 'nn', require('markdown-togglecheck').toggle) + -- -- toggle checkbox (it doesn't remember toggle state and always creates [ ]) + -- vim.api.nvim_set_keymap('n', 'nN', require('markdown-togglecheck').toggle_box) + end + }) - -- Couldn’t move those in mappin.lua - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, {expr=true}) + -- COMPLETION + use{ -- Completion engine + 'hrsh7th/nvim-cmp', + requires = { + "onsails/lspkind-nvim", -- Icons on the popups + "hrsh7th/cmp-nvim-lsp", -- LSP source for nvim-cmp + "saadparwaiz1/cmp_luasnip", -- Snippets source + "L3MON4D3/LuaSnip" + }, + config = function() require'plugins.nvim-cmp' end + } + use 'saadparwaiz1/cmp_luasnip' -- Snippet autocompletion + use 'hrsh7th/cmp-nvim-lsp' -- For autocompletion + use 'hrsh7th/cmp-buffer' -- Source for text in buffer + use 'hrsh7th/cmp-path' -- Source for file system paths - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, {expr=true}) + -- -- GIT + use 'tpope/vim-fugitive' -- Git commands + use { -- Git symbols in gutter & jump and handle hunks + 'lewis6991/gitsigns.nvim', + config = function() require'plugins.gitsigns' end + } - -- Actions - map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') - map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') - map('n', 'hu', gs.undo_stage_hunk) - map('n', 'hp', gs.preview_hunk) - map('n', 'hb', function() gs.blame_line{full=true} end) - map('n', 'tb', gs.toggle_current_line_blame) - map('n', 'hd', gs.diffthis) - end - } - end + -- NAVIGATION + use { + 'nvim-neo-tree/neo-tree.nvim', + branch = "v3.x", + requires = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim' } + } + use { + 'Bekaboo/dropbar.nvim', + -- disable = true + opt = true -- optional + } + use { -- Fuzzy finder + 'nvim-telescope/telescope.nvim', + tag = '0.1.6', + requires = {'nvim-lua/plenary.nvim'}, + config = function() require'plugins.telescope' end + } + use 'christoomey/vim-tmux-navigator' -- Tmux & split window navigation + use { + 'glepnir/dashboard-nvim', + event = 'VimEnter', + config = function() require'plugins.dashboard' end, + requires = {'nvim-tree/nvim-web-devicons'} + } + + -- UI + use { -- Themes + 'navarasu/onedark.nvim', + config = function() require'plugins.onedark' end + } + use { -- Status line + 'feline-nvim/feline.nvim', + branch = '0.5-compat', + config = function() require'plugins.feline' end + } + use 'sangdol/mintabline.vim' -- Add symbol in tab + use 'kyazdani42/nvim-web-devicons' -- Icons + use 'onsails/lspkind.nvim' -- vs-code like icons for autocompletion + use { -- Distraction free visualisation + 'junegunn/goyo.vim', + config = function() require'plugins.goyo' end + } + use 'junegunn/limelight.vim' -- Focus line + use { + 'levouh/tint.nvim', + config = function() require'tint'.setup() end + } + + if packer_bootstrap then + require('packer').sync() end -) +end) diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua deleted file mode 100644 index c64c84a..0000000 --- a/lua/plugins/barbar.lua +++ /dev/null @@ -1,22 +0,0 @@ -require('bufferline').setup { - tabpages = false -} - --- to shift tabs when nerdtree is open -vim.api.nvim_create_autocmd('BufWinEnter', { - pattern = '*', - callback = function() - if vim.bo.filetype == 'NvimTree' then - require'bufferline.state'.set_offset(31, 'FileTree') - end - end -}) - -vim.api.nvim_create_autocmd('BufWinLeave', { - pattern = '*', - callback = function() - if vim.fn.expand(''):match('NvimTree') then - require'bufferline.state'.set_offset(0) - end - end -}) diff --git a/lua/plugins/coc.lua b/lua/plugins/coc.lua deleted file mode 100644 index 617abdb..0000000 --- a/lua/plugins/coc.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.cmd([[ - autocmd ColorScheme * hi CocMenuSel ctermbg=237 guibg=#13354A -]]) diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua new file mode 100644 index 0000000..3b35bab --- /dev/null +++ b/lua/plugins/dashboard.lua @@ -0,0 +1,48 @@ +require('dashboard').setup { + theme = 'hyper', + config = { + week_header = { + enable = true + }, + shortcut = { + { + icon = '', + desc = ' Neovim', + action = 'vim.cmd("cd ~/.config/nvim | edit README.md | Neotree toggle")', + key = 'n' + }, + { + icon = '', + desc = ' Zsh', + action = 'vim.cmd("cd ~/.config/zsh | edit README.md | Neotree toggle")', + key = 'z' + }, + { + icon = '', + desc = ' Tmux', + action = 'vim.cmd("cd ~/.config/tmux | edit README.md | Neotree toggle")', + key = 't' + }, + { + icon = '龎', + desc = ' Docs', + action = 'vim.cmd("cd ~/.local/docs | edit README.md | Neotree toggle")', + key = 'd' + }, + }, + packages = { + enable = false + }, + project = { + limit = 3, + icon = '', + label = '', + action = 'Telescope find_files cwd=' + }, + footer = { + '', + '"La porte du changement ne peut s’ouvrir que de l’intérieur."', + 'Jacques Salomé' + } + } +} diff --git a/lua/plugins/feline.lua b/lua/plugins/feline.lua index 2810b97..9a17a41 100644 --- a/lua/plugins/feline.lua +++ b/lua/plugins/feline.lua @@ -1,18 +1,230 @@ -local gruvbox = { - fg = '#928374', - bg = '#1F2223', - black ='#1B1B1B', - skyblue = '#458588', - cyan = '#83a597', - green = '#689d6a', - oceanblue = '#1d2021', - magenta = '#fb4934', - orange = '#fabd2f', - red = '#cc241d', - violet = '#b16286', - white = '#ebdbb2', - yellow = '#d79921', +local status, feline = pcall(require, "feline") + +if not status then + return +end + +local one_monokai = { + fg = "#abb2bf", + bg = "#282c34", + green = "#98c379", + yellow = "#e5c07b", + purple = "#c678dd", + orange = "#d19a66", + peanut = "#f6d5a4", + red = "#e06c75", + aqua = "#61afef", + darkblue = "#282c34", + dark_red = "#f75f5f", +} + +local vi_mode_colors = { + NORMAL = "green", + OP = "green", + INSERT = "gray", + VISUAL = "purple", + LINES = "orange", + BLOCK = "dark_red", + REPLACE = "red", + COMMAND = "aqua", +} + +local c = { + vim_mode = { + provider = { + name = "vi_mode", + opts = { + show_mode_name = true, + padding = "center", + }, + }, + hl = function() + return { + fg = require("feline.providers.vi_mode").get_mode_color(), + style = "bold", + name = "NeovimModeHLColor", + } + end, + left_sep = "block", + right_sep = "block", + }, + gitBranch = { + provider = "git_branch", + icon = ' ', + hl = { + fg = "gray", + style = "bold", + }, + left_sep = "block", + right_sep = "block", + }, + gitDiffAdded = { + provider = "git_diff_added", + icon = '✔ ', + hl = { + fg = "green", + }, + left_sep = "block", + right_sep = "block", + }, + gitDiffRemoved = { + provider = "git_diff_removed", + icon = '🗶 ', + hl = { + fg = "red", + }, + left_sep = "block", + right_sep = "block", + }, + gitDiffChanged = { + provider = "git_diff_changed", + icon = '🟓 ', + hl = { + fg = "yellow", + }, + left_sep = "block", + right_sep = "block", + }, + separator = { + provider = "", + }, + fileinfo = { + provider = { + name = "file_info", + opts = { + type = "relative-short", + }, + }, + hl = { + }, + left_sep = " ", + right_sep = " ", + }, + diagnostic_errors = { + provider = "diagnostic_errors", + hl = { + fg = "red", + }, + }, + diagnostic_warnings = { + provider = "diagnostic_warnings", + hl = { + fg = "yellow", + }, + }, + diagnostic_hints = { + provider = "diagnostic_hints", + hl = { + fg = "aqua", + }, + }, + diagnostic_info = { + provider = "diagnostic_info", + hl = { + bg = "darkblue" + } + }, + lsp_client_names = { + provider = "lsp_client_names", + hl = { + fg = "purple", + style = "bold", + }, + left_sep = "block", + right_sep = "block", + }, + file_type = { + provider = { + name = "file_type", + opts = { + filetype_icon = true, + case = "titlecase", + }, + }, + hl = { + fg = "red", + style = "bold", + }, + left_sep = "block", + right_sep = "block", + }, + file_encoding = { + provider = "file_encoding", + hl = { + fg = "orange", + style = "italic", + }, + left_sep = "block", + right_sep = "block", + }, + position = { + provider = "position", + hl = { + fg = "green", + style = "bold", + }, + left_sep = "block", + right_sep = "block", + }, + line_percentage = { + provider = "line_percentage", + hl = { + fg = "aqua", + style = "bold", + }, + left_sep = "block", + right_sep = "block", + }, + scroll_bar = { + provider = "scroll_bar", + hl = { + fg = "yellow", + style = "bold", + }, + }, +} + +local left = { + c.vim_mode, + c.gitBranch, + c.gitDiffAdded, + c.gitDiffRemoved, + c.gitDiffChanged, + c.separator, +} + +local middle = { + c.fileinfo, + c.diagnostic_errors, + c.diagnostic_warnings, + c.diagnostic_info, + c.diagnostic_hints, +} + +local right = { + c.lsp_client_names, + c.file_type, + c.file_encoding, + c.position, + c.line_percentage, + c.scroll_bar, +} + +local components = { + active = { + left, + middle, + right, + }, + inactive = { + left, + middle, + right, + }, } -local feline = require('feline') -feline.setup({theme = gruvbox}) +feline.setup({ + components = components, + theme = one_monokai, + vi_mode_colors = vi_mode_colors, +}) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..2aa28d5 --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,42 @@ +require('gitsigns').setup { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + current_line_blame = true, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- Actions + map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') + map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') + map('n', 'hu', gs.undo_stage_hunk) + map('n', 'hp', gs.preview_hunk) + map('n', 'hb', function() gs.blame_line{full=true} end) + map('n', 'tb', gs.toggle_current_line_blame) + map('n', 'hd', gs.diffthis) + end +} diff --git a/lua/plugins/goyo.lua b/lua/plugins/goyo.lua new file mode 100644 index 0000000..c3867c5 --- /dev/null +++ b/lua/plugins/goyo.lua @@ -0,0 +1,6 @@ +vim.cmd([[ + augroup goyo_and_co + autocmd! User GoyoEnter Limelight + autocmd! User GoyoLeave Limelight! + augroup end +]]) diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua deleted file mode 100644 index 2d61543..0000000 --- a/lua/plugins/indent-blankline.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("indent_blankline").setup { - char = '┆', - show_current_context = true, -- globally enable or not - show_current_context_start = true, -- signature (or just start object) context - show_trailing_blankline_indent = false, - show_first_indent_level= false, -} diff --git a/lua/plugins/lspsaga-nvim.lua b/lua/plugins/lspsaga-nvim.lua new file mode 100644 index 0000000..a798d9b --- /dev/null +++ b/lua/plugins/lspsaga-nvim.lua @@ -0,0 +1,2 @@ +local saga = require'lspsaga' +saga.setup({}) diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua new file mode 100644 index 0000000..6a38167 --- /dev/null +++ b/lua/plugins/mason-lspconfig.lua @@ -0,0 +1,24 @@ +require'mason'.setup() +local mason_lspconfig = require'mason-lspconfig' +mason_lspconfig.setup({ + ensure_installed = { + 'cssls', + 'dockerls', + 'eslint', + 'html', + 'intelephense', + 'jsonls', + 'lua_ls', + 'marksman', + 'pylsp', + 'basedpyright', + 'ruby_lsp', + 'solargraph', + 'sqlls', + 'tailwindcss', + 'ts_ls', + 'vue_ls', + 'yamlls' + }, + automatic_enable = true, +}) diff --git a/lua/plugins/nvim-autopairs.lua b/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..8b0d9e6 --- /dev/null +++ b/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,16 @@ +local autopairs = require'nvim-autopairs' + +-- configure autopairs +autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = {"string"}, -- don't add pairs in lua string treesitter nodes + javascript = {"template_string"}, -- don't add pairs in javscript template_string treesitter nodes + }, +}) + +local cmp_autopairs = require'nvim-autopairs.completion.cmp' +local cmp = require'cmp' + +-- make autopairs and completion work together +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..2bb1cce --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,31 @@ +local cmp = require'cmp' +local luasnip = require'luasnip' +local lspkind = require'lspkind' + +require('cmp').setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm({ select = false }), + }), + + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, -- lsp + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + + -- configure lspkind for vs-code like icons + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "…", + }), + }, +} diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua index f306b61..de81168 100644 --- a/lua/plugins/nvim-lint.lua +++ b/lua/plugins/nvim-lint.lua @@ -2,10 +2,11 @@ local lint = require 'lint' local linters = lint.linters -- JS -linters.eslint.cmd = '/usr/lib/node_modules/eslint/bin/eslint.js' +linters.eslint.cmd = '/usr/local/bin/eslint' local eslint = require('lint.linters.eslint') eslint.args = { - '-c=/home/tarik/.config/nvim/eslint.json', + '--config', + '/home/tarik/.config/nvim/eslint.config.js', } -- PHP @@ -14,6 +15,7 @@ local phpcs = require('lint.linters.phpcs') phpcs.args = { '-q', '--standard=/home/tarik/.config/nvim/standard.xml', + '--extensions=php', '--report=json', '-' } @@ -21,7 +23,11 @@ phpcs.args = { -- All lint.linters_by_ft = { javascript = {'eslint'}, - php = {'phpcs'} + typescript = {'eslint'}, + typescriptreact = {'eslint'}, + php = {'phpcs'}, + ruby = {'ruby'}, + vue = {'eslint'} } vim.cmd('autocmd BufEnter,BufWritePost,InsertLeave * lua require("lint").try_lint()') diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..38bd06c --- /dev/null +++ b/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1,187 @@ +local cmp_nvim_lsp = require'cmp_nvim_lsp' + +local keymap = vim.keymap -- for conciseness + +-- enable keybinds only for when lsp server available +local on_attach = function(client, bufnr) + -- keybind options + local opts = { noremap = true, silent = true, buffer = bufnr } + + -- set keybinds + keymap.set("n", "gf", "Lspsaga lsp_finder", opts) -- show definition, references + keymap.set("n", "gD", "lua vim.lsp.buf.declaration()", opts) -- got to declaration + keymap.set("n", "gd", "Lspsaga peek_definition", opts) -- see definition and make edits in window + keymap.set("n", "gi", "lua vim.lsp.buf.implementation()", opts) -- go to implementation + keymap.set("n", "ca", "Lspsaga code_action", opts) -- see available code actions + keymap.set("n", "rn", "Lspsaga rename", opts) -- smart rename + keymap.set("n", "D", "Lspsaga show_line_diagnostics", opts) -- show diagnostics for line + keymap.set("n", "d", "Lspsaga show_cursor_diagnostics", opts) -- show diagnostics for cursor + keymap.set("n", "[d", "Lspsaga diagnostic_jump_prev", opts) -- jump to previous diagnostic in buffer + keymap.set("n", "]d", "Lspsaga diagnostic_jump_next", opts) -- jump to next diagnostic in buffer + keymap.set("n", "K", "Lspsaga hover_doc", opts) -- show documentation for what is under cursor + keymap.set("n", "s", "LSoutlineToggle", opts) -- see outline on right hand side + keymap.set("n", "f", "lua vim.lsp.buf.format {async = true}", opts) -- format current buffer +end + +-- used to enable autocompletion (assign to every lsp server config) +local capabilities = cmp_nvim_lsp.default_capabilities() + +-- Change the Diagnostic symbols in the sign column (gutter) +local signs = { Error = " ", Warn = " ", Hint = "󰋇 ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) +end + +-- Lsp list: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md + +vim.lsp.config('ts_ls', { + capabilities = capabilities, + on_attach = on_attach, + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' }, + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = vim.fn.expand('~/.local/share/nvim/mason/packages/vue-language-server/node_modules/@vue/typescript-plugin'), + languages = { 'javascript', 'typescript', 'vue' }, + }, + }, + }, +}) + +vim.lsp.config('vue_ls', { + capabilities = capabilities, + on_attach = on_attach, + filetypes = {'vue'}, +}) + +vim.lsp.config('html', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('cssls', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('tailwindcss', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('lua_ls', { + capabilities = capabilities, + on_attach = on_attach, + settings = { -- custom settings for lua + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- make language server aware of runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, +}) + +vim.lsp.config('dockerls', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('eslint', { + capabilities = capabilities, + on_attach = on_attach, + settings = { + options = { + overrideConfigFile = vim.fn.expand('~/.config/nvim/eslint.config.js') + }, + useFlatConfig = true + } +}) + +vim.lsp.config('jsonls', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('marksman', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('phpactor', { + capabilities = capabilities, + on_attach = on_attach, + init_options = { + ["language_server_phpstan.enabled"] = false, + ["language_server_psalm.enabled"] = false, + } +}) + +vim.lsp.config('intelephense', { + capabilities = capabilities, + on_attach = on_attach, + flags = { + debounce_text_changes = 150, + }, +}) + +vim.lsp.config('ruby_lsp', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('solargraph', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('sqlls', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('yamlls', { + capabilities = capabilities, + on_attach = on_attach, +}) + +vim.lsp.config('pylsp', { + capabilities = capabilities, + on_attach = on_attach, + settings = { + pylsp = { + plugins = { + black = { enabled = true }, + pylsp_mypy = { enabled = true }, + pyls_isort = { enabled = true }, + }, + }, + }, +}) + +vim.lsp.config('basedpyright', { + capabilities = capabilities, + on_attach = on_attach, + settings = { + basedpyright = { + autoImportCompletion = true + }, + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = 'openFilesOnly', + useLibraryCodeForTypes = true, + typeCheckingMode = 'off' + } + } + } +}) diff --git a/lua/plugins/nvim-ts-autotag.lua b/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..c10f4ea --- /dev/null +++ b/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1,12 @@ +-- import nvim-treesitter plugin safely +local status, treesitter = pcall(require, "nvim-treesitter.configs") + +if not status then + return +end + +treesitter.setup { + autotag = { + enable = true, + } +} diff --git a/lua/plugins/onedark.lua b/lua/plugins/onedark.lua index c25985b..844dfbf 100644 --- a/lua/plugins/onedark.lua +++ b/lua/plugins/onedark.lua @@ -1,5 +1,7 @@ require('onedark').setup{ -- dark, darker, warm, warmer - style = 'warm' + style = 'warm', + toggle_style_list = {'warm', 'light'}, + toggle_style_key = 't' } require('onedark').load() diff --git a/lua/plugins/overlength.lua b/lua/plugins/overlength.lua new file mode 100644 index 0000000..84ed7f0 --- /dev/null +++ b/lua/plugins/overlength.lua @@ -0,0 +1,34 @@ +require('overlength').setup({ + -- Overlength highlighting enabled by default + enabled = true, + + -- Colors for highlight by specifying a ctermbg and bg + -- ctermbg = 'darkgrey', + bg = '#260000', + + -- Mode to use textwidth local options + -- 0: Don't use textwidth at all, always use config.default_overlength. + -- 1: Use `textwidth, unless it's 0, then use config.default_overlength. + -- 2: Always use textwidth. There will be no highlighting where + -- textwidth == 0, unless added explicitly + textwidth_mode = 1, + -- Default overlength with no filetype + default_overlength = 120, + -- How many spaces past your overlength to start highlighting + grace_length = 1, + -- Highlight only the column or until the end of the line + highlight_to_eol = true, + + -- List of filetypes to disable overlength highlighting + disable_ft = { + 'qf', + 'help', + 'man', + 'packer', + 'NvimTree', + 'Telescope', + 'WhichKey', + 'markdown', + 'dashboard' + } +}) diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua deleted file mode 100644 index 1b382ff..0000000 --- a/lua/plugins/tree.lua +++ /dev/null @@ -1,8 +0,0 @@ -require('nvim-tree').setup { - filters = { - dotfiles = false, - custom = {'.git'} - }, - open_on_tab = true, - hijack_cursor = true -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index c5d4dbb..13e60a8 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,8 +1,29 @@ -require('nvim-treesitter.configs').setup { - -- A list of parser names, or 'all' +-- import nvim-treesitter plugin safely +local status, treesitter = pcall(require, "nvim-treesitter.configs") + +if not status then + return +end + +treesitter.setup { + -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { + enable = true, + disable = { 'ruby', 'vue' } + }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = {enable = true}, + -- ensure these language parsers are installed ensure_installed = { 'css', 'dockerfile', + 'git_rebase', + 'gitattributes', + 'gitcommit', 'html', 'javascript', 'jsdoc', @@ -20,6 +41,7 @@ require('nvim-treesitter.configs').setup { 'sql', 'tsx', 'typescript', + 'vue', 'yaml' }, -- Automatically install missing parsers when entering buffer diff --git a/my_snippets/package.json b/my_snippets/package.json new file mode 100644 index 0000000..7aaebc4 --- /dev/null +++ b/my_snippets/package.json @@ -0,0 +1,13 @@ +{ + "name": "tariks-snippets", + "contributes": { + "snippets": [ + { + "language": [ + "javascript" + ], + "path": "./snippets/javascript.json" + } + ] + } +} diff --git a/my_snippets/snippets/javascript.json b/my_snippets/snippets/javascript.json new file mode 100644 index 0000000..84ee85d --- /dev/null +++ b/my_snippets/snippets/javascript.json @@ -0,0 +1,6 @@ +{ + "console.log": { + "prefix": "c", + "body": "console.log(${0})" + } +} diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..79bda47 Binary files /dev/null and b/screenshot.png differ diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index a059bb7..d723b03 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -1 +1,10 @@ javascript +import/! +entry/! +Remove/! +$parameters/! +class/! +if/! +cci/! +test_current_config_connections +log_progress/! diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 571c0bf..38448e3 100644 Binary files a/spell/en.utf-8.add.spl and b/spell/en.utf-8.add.spl differ diff --git a/standard.xml b/standard.xml index c245460..59af198 100644 --- a/standard.xml +++ b/standard.xml @@ -1,42 +1,5 @@ - My custom Zend coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + My custom standard. +