view runtime/indent/xf86conf.vim @ 35112:51e50414b5ee default tip

translation(sr): update Serbian menu Commit: https://github.com/vim/vim/commit/5bf7446ba2b2eab36685176379a642472891ff88 Author: Oleg Zadorozhnyi <lesorubshayan@gmail.com> Date: Thu May 2 22:16:10 2024 +0200 translation(sr): update Serbian menu closes: https://github.com/vim/vim/issues/14669 closes: https://github.com/vim/vim/issues/10722 Signed-off-by: Oleg Zadorozhnyi <lesorubshayan@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 02 May 2024 22:30:03 +0200
parents 4d76b3e07c07
children
line wrap: on
line source

" Vim indent file
" Language:		XFree86 Configuration File
" Maintainer:		Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer:	Nikolai Weibull <now@bitwi.se>
" Last Change:		2022 April 25

if exists("b:did_indent")
  finish
endif
let b:did_indent = 1

setlocal indentexpr=GetXF86ConfIndent()
setlocal indentkeys=!^F,o,O,=End
setlocal nosmartindent

let b:undo_indent = "setl inde< indk< si<"

if exists("*GetXF86ConfIndent")
  finish
endif

function GetXF86ConfIndent()
  let lnum = prevnonblank(v:lnum - 1)

  if lnum == 0
    return 0
  endif

  let ind = indent(lnum)

  if getline(lnum) =~? '^\s*\(Sub\)\=Section\>'
    let ind = ind + shiftwidth()
  endif

  if getline(v:lnum) =~? '^\s*End\(Sub\)\=Section\>'
    let ind = ind - shiftwidth()
  endif

  return ind
endfunction