Index ¦ Archives

Neovim

Neovim is a refactor, and sometimes redactor, in the tradition of Vim (which itself derives from Stevie). It is not a rewrite but a continuation and extension of Vim. Many clones and derivatives exist, some very clever—but none are Vim. Neovim is built for users who want the good parts of Vim, and more.

Goals

  • Enable new contributors, remove barriers to entry.
  • Unblock plugin authors.
  • Develop first-class Lua/LuaJIT scripting alternative to VimL.
  • Target all platforms supported by libuv.
  • Leverage ongoing Vim development.
  • Optimize out of the box, for new users but especially regular users.
  • Deliver consistent cross-platform experience.
  • In matters of taste/ambiguity, favor tradition/compatibility...
  • ...but prefer usability if the benefits are extreme.

Non-goals

  • Turn Vim into an IDE
  • Limit third-party applications (such as IDEs!) built with Neovim
  • Deprecate VimL
  • POSIX vi-compatibility

Install

sudo apt install neovim

Packer

git clone --depth 1 https://github.com/wbthomason/packer.nvim\
 ~/.local/share/nvim/site/pack/packer/start/packer.nvim

echo "lua require('plugins')" > ~/.config/nvim/init.vim

nvim ~/.config/nvim/lua/plugins.lua

return require('packer').startup(function(use)
    -- Packer
    use 'wbthomason/packer.nvim'

    -- Global
    vim.cmd[[syntax on]]
    vim.cmd[[filetype plugin on]]
    vim.cmd[[set encoding=UTF-8]]
    vim.cmd[[set textwidth=79]]
    vim.cmd[[set tabstop=4]]
    vim.cmd[[set shiftwidth=4]]
    vim.cmd[[set softtabstop=4]]
    vim.cmd[[set autoindent]]
    vim.cmd[[set expandtab]]
    vim.cmd[[set smarttab]]
    vim.cmd[[set laststatus=4]]
    vim.cmd[[set ignorecase]]
    vim.cmd[[set t_Co=256]]
    vim.cmd[[set noshowmode]]
    vim.cmd[[set hlsearch]]
    vim.cmd[[set hidden]]
    vim.cmd[[set nobuflisted]]
    vim.cmd[[set encoding=UTF-8]]

    -- Shortcut
    vim.cmd[[nmap <C-t> :Telescope<CR>]]

    -- Theme
    use 'navarasu/onedark.nvim'
    require('onedark').setup{
        style = 'darker',
        transparent = true
    }
    require('onedark').load()
    use {
        'nvim-lualine/lualine.nvim',
        requires = { 
            'kyazdani42/nvim-web-devicons',
            opt = true
        }
    }
    require('lualine').setup{
        options = { 
            theme = 'onedark' 
        }
    }
    require('lualine').get_config()

    -- Git
    use {
        'lewis6991/gitsigns.nvim',
        config = function()
            require('gitsigns').setup()
        end
    }
    use 'f-person/git-blame.nvim'
    vim.cmd[[let g:git_blame_enabled = 1]]


    -- Autopairs
    use {
        'windwp/nvim-autopairs',
        config = function()
            require('nvim-autopairs').setup {}
        end
    }

    -- Indent
    use 'lukas-reineke/indent-blankline.nvim'
    require('indent_blankline').setup {
        show_current_context = true,
        show_current_context_start = true
    }

    -- LPS
    use 'neovim/nvim-lspconfig'
    use 'williamboman/nvim-lsp-installer'
    require'lspconfig'.pyright.setup{}
    require'lspconfig'.purescriptls.setup{}

    -- Autocomplete
    use 'hrsh7th/nvim-cmp'
    use 'hrsh7th/cmp-buffer'
    use 'hrsh7th/cmp-path'
    use 'saadparwaiz1/cmp_luasnip'
    use 'hrsh7th/cmp-nvim-lsp'
    use 'hrsh7th/cmp-nvim-lua'

    -- Telescope
    use { 'nvim-telescope/telescope.nvim', tag = '0.1.0' }
    use 'nvim-lua/plenary.nvim'
    use 'BurntSushi/ripgrep'
    use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
    use 'sharkdp/fd'
    use 'nvim-treesitter/nvim-treesitter'
    require'nvim-treesitter.configs'.setup {
        ensure_installed = { 'c', 'cpp', 'python', 'lua', 'go', 'rust', 'typescript', 'help' },
        sync_install = false,
        auto_install = true,
        indent = {
            enable = true
        }
    }

    -- Snipet
    if PACKER_BOOTSTRAP then
        require("packer").sync()
    end

end)

Sync

nvim

:PackerSync
:PackerStatus

Neovim

© 2000-2022 by Daniel Pimentel (d4n1). Under MIT.