aboutsummaryrefslogtreecommitdiff
path: root/init.lua
blob: 17915db4f8c608c7443f1377c86c39aff356c20e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE.

require 'ext/pm'
require 'ext/find'
require 'ext/mime_types'
require 'ext/keys'

local mpath = _HOME..'modules/?.lua;'.._HOME..'/modules/?/init.lua'
package.path  = package.path..';'..mpath

-- modules to load on startup
require 'textadept'
-- end modules

require 'ext/key_commands'

-- process command line arguments
local textadept = textadept
if #arg == 0 then
  textadept.io.load_session()
else
  local base_dir = arg[0]:match('^.+/') or ''
  local filepath
  for _, filename in ipairs(arg) do
    if not filename:match('^~?/') then
      textadept.io.open(base_dir..filename)
    else
      textadept.io.open(filename)
    end
  end
  textadept.pm.entry_text = 'buffers'
  textadept.pm.activate()
end